Hi there,
I'm trying to connect my proxy to a target endpoint which requires Two-way TLS. I went to "Management -> Environments", selected my environemnt and on the TLS Keystores tab I imported my .p12 file and gave an alias.
Then, on the Target Servers tab, I clicked on the edit for my target server configuration and added this keystore and selected the alias. This works just fine and my proxy can communicate with the backend server.
But I wanted to use flow variables on the target flow instead of this manual configuration:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="AM-SSLConnect">
<DisplayName>AM-SSLConnect</DisplayName>
<Properties/>
<AssignVariable>
<Name>myvars.ssl.enabled</Name>
<Value>true</Value>
</AssignVariable>
<AssignVariable>
<Name>myvars.ssl.client.auth.enabled</Name>
<Value>true</Value>
</AssignVariable>
<AssignVariable>
<Name>myvars.ssl.keystore</Name>
<Value>my_keystore</Value>
</AssignVariable>
<AssignVariable>
<Name>myvars.ssl.keyAlias</Name>
<Value>my_alias</Value>
</AssignVariable>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>
I add this on the pre flow step. Unfortunately, I receive a Handshake failure.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TargetEndpoint name="default">
<PreFlow name="PreFlow">
<Request>
<Step>
<Name>AM-SSLConnect</Name>
</Step>
</Request>
</PreFlow>
<HTTPTargetConnection>
<LoadBalancer>
<Server name="my_target_server"/>
</LoadBalancer>
<Path>/path/...</Path>
<SSLInfo>
<Enabled>{myvars.ssl.enabled}</Enabled>
<ClientAuthEnabled>{myvars.ssl.client.auth.enabled}</ClientAuthEnabled>
<KeyStore>{myvars.ssl.keystore}</KeyStore>
<KeyAlias>{myvars.ssl.keyAlias}</KeyAlias>
</SSLInfo>
</HTTPTargetConnection>
</TargetEndpoint>
Can someone point to me what is missing?
{
"fault": {
"faultstring": "SSL Handshake failed null",
"detail": {
"errorcode": "messaging.adaptors.http.flow.SslHandshakeFailed"
}
}
}
Solved! Go to Solution.
Hey @AndreCipriano , you are mixing up two different things - TargetEndpoint TLS configuration and Target Servers.
This part
<SSLInfo> <Enabled>{myvars.ssl.enabled}</Enabled> <ClientAuthEnabled>{myvars.ssl.client.auth.enabled}</ClientAuthEnabled> <KeyStore>{myvars.ssl.keystore}</KeyStore> <KeyAlias>{myvars.ssl.keyAlias}</KeyAlias> </SSLInfo>
would work if you remove Path and LoadBalancer, and add target URL, like here
Hope that helps!
@AndreCipriano - a few questions to clarify:
Hey @AndreCipriano , you are mixing up two different things - TargetEndpoint TLS configuration and Target Servers.
This part
<SSLInfo> <Enabled>{myvars.ssl.enabled}</Enabled> <ClientAuthEnabled>{myvars.ssl.client.auth.enabled}</ClientAuthEnabled> <KeyStore>{myvars.ssl.keystore}</KeyStore> <KeyAlias>{myvars.ssl.keyAlias}</KeyAlias> </SSLInfo>
would work if you remove Path and LoadBalancer, and add target URL, like here
Hope that helps!
You are correct, I was confused, used the way described in https://cloud.google.com/apigee/docs/api-platform/deploy/load-balancing-across-backend-servers#confi... and it worked!
Thanks 🙂