File tree Expand file tree Collapse file tree 6 files changed +19
-11
lines changed
Expand file tree Collapse file tree 6 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -144,8 +144,8 @@ function install_ca_certificate
144144
145145 openssl s_client -connect localhost:5671 \
146146 -CAfile " $GITHUB_WORKSPACE /.ci/certs/ca_certificate.pem" \
147- -cert " $GITHUB_WORKSPACE /.ci/certs/client_localhost_certificate .pem" \
148- -key " $GITHUB_WORKSPACE /.ci/certs/client_localhost_key .pem" \
147+ -cert " $GITHUB_WORKSPACE /.ci/certs/client_direct_certificate .pem" \
148+ -key " $GITHUB_WORKSPACE /.ci/certs/client_direct_key .pem" \
149149 -pass pass:grapefruit < /dev/null
150150}
151151
Original file line number Diff line number Diff line change @@ -11,6 +11,6 @@ loopback_users.guest = true
1111ssl_options.verify = verify_peer
1212ssl_options.fail_if_no_peer_cert = true
1313ssl_options.cacertfile = /etc/rabbitmq/certs/ca_certificate.pem
14- ssl_options.certfile = /etc/rabbitmq/certs/server_localhost_certificate .pem
15- ssl_options.keyfile = /etc/rabbitmq/certs/server_localhost_key .pem
14+ ssl_options.certfile = /etc/rabbitmq/certs/server_direct_certificate .pem
15+ ssl_options.keyfile = /etc/rabbitmq/certs/server_direct_key .pem
1616ssl_options.password = grapefruit
Original file line number Diff line number Diff line change @@ -240,7 +240,11 @@ $ErrorActionPreference = 'Continue'
240240Write-Host ' [INFO] Enabling plugins...'
241241& $rabbitmq_plugins_path enable rabbitmq_management rabbitmq_stream rabbitmq_stream_management rabbitmq_amqp1_0
242242
243- echo Q | openssl s_client - connect localhost:5671 - CAfile " $certs_dir /ca_certificate.pem" - cert " $certs_dir /client_localhost_certificate.pem" - key " $certs_dir /client_localhost_key.pem" - pass pass:grapefruit
243+ echo Q | openssl s_client - connect localhost:5671 `
244+ - CAfile " $certs_dir /ca_certificate.pem" `
245+ - cert " $certs_dir /client_direct_certificate.pem" `
246+ - key " $certs_dir /client_direct_key.pem" `
247+ - pass pass:grapefruit
244248if ($LASTEXITCODE -ne 0 )
245249{
246250 throw " [ERROR] 'openssl s_client' returned error: $LASTEXITCODE "
Original file line number Diff line number Diff line change @@ -10,6 +10,6 @@ loopback_users.guest = true
1010ssl_options.verify = verify_peer
1111ssl_options.fail_if_no_peer_cert = true
1212ssl_options.cacertfile = @@CERTS_DIR@@/ca_certificate.pem
13- ssl_options.certfile = @@CERTS_DIR@@/server_localhost_certificate .pem
14- ssl_options.keyfile = @@CERTS_DIR@@/server_localhost_key .pem
13+ ssl_options.certfile = @@CERTS_DIR@@/server_direct_certificate .pem
14+ ssl_options.keyfile = @@CERTS_DIR@@/server_direct_key .pem
1515ssl_options.password = grapefruit
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ public SslEnv()
5252
5353 if ( _isSslConfigured )
5454 {
55- _certPath = Path . Combine ( _sslDir , $ "client_ { _hostname } .p12") ;
55+ _certPath = Path . Combine ( _sslDir , $ "client .p12") ;
5656 }
5757 }
5858
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ public async Task TestServerVerifiedIgnoringNameMismatch()
6464 ConnectionFactory cf = CreateConnectionFactory ( ) ;
6565 cf . Port = 5671 ;
6666 cf . Ssl . ServerName = "*" ;
67+ cf . Ssl . CertPath = certPath ;
6768 cf . Ssl . AcceptablePolicyErrors = SslPolicyErrors . RemoteCertificateNameMismatch ;
6869 cf . Ssl . Enabled = true ;
6970
@@ -78,6 +79,7 @@ public async Task TestServerVerified()
7879 ConnectionFactory cf = CreateConnectionFactory ( ) ;
7980 cf . Port = 5671 ;
8081 cf . Ssl . ServerName = _sslEnv . Hostname ;
82+ cf . Ssl . CertPath = certPath ;
8183 cf . Ssl . Enabled = true ;
8284
8385 await SendReceiveAsync ( cf ) ;
@@ -101,17 +103,19 @@ public async Task TestClientAndServerVerified()
101103 await SendReceiveAsync ( cf ) ;
102104 }
103105
104- // rabbitmq/rabbitmq-dotnet-client#46, also #44 and #45
105106 [ SkippableFact ]
106- public async Task TestNoClientCertificate ( )
107+ public async Task TestWithClientCertificate ( )
107108 {
108109 Skip . IfNot ( _sslEnv . IsSslConfigured , "SSL_CERTS_DIR and/or PASSWORD are not configured, skipping test" ) ;
109110
111+ string certPath = _sslEnv . CertPath ;
112+ Assert . True ( File . Exists ( certPath ) ) ;
113+
110114 ConnectionFactory cf = CreateConnectionFactory ( ) ;
111115 cf . Port = 5671 ;
112116 cf . Ssl = new SslOption ( )
113117 {
114- CertPath = null ,
118+ CertPath = certPath ,
115119 Enabled = true ,
116120 ServerName = _sslEnv . Hostname ,
117121 Version = SslProtocols . None ,
You can’t perform that action at this time.
0 commit comments