Hi,
I have two HA triplets and I am trying to setup the SSL based native Solace Replication (Async) between them.
Attempt 1:
I generated server certificate with following instructions:
openssl req -x509 -newKey rsa:4096 -keyout certs/solace_server.key -out certs/solace_server.crt -days 365
cat certs/solace_server.key certs/solace_server.crt > certs/solace_server.pem
Loaded it on to both triplets (primaries and secondaries) using following CLI command:
enable configure ssl server-certificate file solace_server.pem
also generated client certificate using following commands:
./keytool -genKey -keyalg RSA -alias client -keystore certs/client.keystore -storepass <pwd> -validity 365 -startdate -1d -keysize 4096
./keytool -keystore certs/client.keystore -export -alias client > certs/client.crt
openssl x509 -out certs/client.pem -outform pem -text -in certs/client.crt -inform der
and loaded it to both HA triplets(Primaries and secondaries from CLI as following:
enable configure authentication create certificate-authority client
certificate file client.pem
When I enable the replication between HA Triplet 1 and 2 I get below exception:
2020-10-08T16:46:09.784+00:00 <local4.info> ip-x-x-x-x event: SYSTEM: SYSTEM_SSL_CONNECTION_REJECTED: - - SSL Connection rejected: reason (certificate verify failed: self signed certificate); connection to y.y.y.y:55443 from x.x.x.x:33282
Note: I have masked ip addresses. x.x.x.x
is primary of HA triplet 1. y.y.y.y
is primary of HA triplet 2.
Attempt 2:
Generated root ca and leaf certificates using following commands (Two certs in Chain - Self signed CA):
openssl genrsa -out root.key 4096
openssl req -new -key root.key -out root.csr -config root_req.config
openssl ca -in root.csr -out root.pem -config root.config -selfsign -extfile ca.ext -days 1095
openssl genrsa -out leaf.key 4096
openssl req -new -key leaf.key -out leaf.csr -config leaf_req.config
openssl ca -in leaf.csr -out leaf.pem -config root.config -extfile ca.ext -days 1095
Loaded leaf.pem as follows in both triplets:
enable configure ssl server-certificate file leaf.pem
Loaded root.pem as follows in both triplets:
enable configure authentication create certificate-authority solace_ca
certificate file root.pem
Now, with this Primary node in HA triplet 1 is getting following exception while connecting to primary node of HA triplet 2:
020-10-15T17:23:42.852+00:00 <local4.info> ip-x.x.x.x event: SYSTEM: SYSTEM_SSL_CONNECTION_REJECTED: - - SSL Connection rejected: reason (certificate verify failed: not trusted common name); connection to y.y.y.y:55443 from x.x.x.x:40027
I enabled debug logging to see what’s wrong and I found below logs:
020-10-15T15:51:20.210+00:00 <local0.debug> ip-x.x.x.x mgmtplane: /usr/sw authenticationThread.cpp:614 (MP_AUTH - 0x00000000) AuthenticationThread(10)@mgmtplane(9) DEBUG Received IPC message MSGTYPE_SSL_CERT_VERIFICATION_REQUEST
2020-10-15T15:51:20.210+00:00 <local0.debug> ip-x.x.x.x mgmtplane: /usr/sw authClientCertificate.cpp:851 (MP_AUTH - 0x00000001) AuthenticationThread(10)@mgmtplane(9) DEBUG X509 peer certificate processing request chain size=1267 client id=1 conn type = 59
2020-10-15T15:51:20.210+00:00 <local0.debug> ip-x.x.x.x mgmtplane: /usr/sw authClientCertificate.cpp:892 (MP_AUTH - 0x00000001) AuthenticationThread(10)@mgmtplane(9) DEBUG X509 peer certificate about to verify chain size=1267, chainLengthFromPeer=1
2020-10-15T15:51:20.210+00:00 <local0.debug> ip-x.x.x.x mgmtplane: /usr/sw authClientCertificate.cpp:909 (MP_AUTH - 0x00000001) AuthenticationThread(10)@mgmtplane(9) DEBUG X509 peer certificate verification succeed
2020-10-15T15:51:20.210+00:00 <local0.debug> ip-x.x.x.x mgmtplane: /usr/sw authClientCertificate.cpp:922 (MP_AUTH - 0x00000001) AuthenticationThread(10)@mgmtplane(9) DEBUG X509 peer certificate username=Solace Leaf
2020-10-15T15:51:20.210+00:00 <local0.debug> ip-x.x.x.x mgmtplane: /usr/sw authClientCertificate.cpp:1018 (MP_AUTH - 0x00000001) AuthenticationThread(10)@mgmtplane(9) DEBUG X509 certificate fail to get valid SAN
2020-10-15T15:51:20.210+00:00 <local0.debug> ip-x.x.x.x mgmtplane: /usr/sw authClientCertificate.cpp:1640 (MP_AUTH - 0x00000001) AuthenticationThread(10)@mgmtplane(9) DEBUG Authenticate SSL bridge[1]: CN = Solace Leaf, isValid = 1, chain len 2
2020-10-15T15:51:20.210+00:00 <local0.debug> ip-x.x.x.x mgmtplane: /usr/sw authClientCertificate.cpp:1689 (MP_AUTH - 0x00000001) AuthenticationThread(10)@mgmtplane(9) DEBUG Authenticate SSL bridge[1]: No match for common name Solace Leaf
2020-10-15T15:51:20.210+00:00 <local0.debug> ip-x.x.x.x mgmtplane: /usr/sw ipcMsg.cpp:1707 (BASE_IPC - 0x00000000) AuthenticationThread(10)@mgmtplane(9) DEBUG Attempt to send message len 1971 to linecard
I tried almost all instructions specified in the documentation. In fact following NOTE from official documentation is confusing to me and I am trying to crack my head on setting up the replication with SSL:
After TLS/SSL is enabled on the replication Config-Sync bridges, for authentication using SSL to succeed, the following must be also be configured:
an SSL server certificate on the remote event broker
a matching trusted CA on the local event broker
the connect port used for the replication mate must be set as SSL
When SSL is enabled for the bridge, the replication mates that you set must use SSL connect ports (see Configuring Replication Mates).
Here is the link to the documentation:
My attempt 2 was based on above explanation and the note. I am not sure if I understood the documentation’s point of view properly.
Could someone please help me understand what I’m doing wrong? and help doing it right way as from generating self signed CA and certificates/keys to loading them properly to both triplets?
Thanks,
Raghu