Killer Queen
Killer Queen

Reputation: 756

Secure handshake failing during IBM.MQ MQQueueManager on Linux .Net Managed

Trying to change CipherSpec from TLS_RSA_WITH_AES_256_CBC_SHA256 to TLS_AES_256_GCM_SHA384. For TLS_RSA_WITH_AES_256_CBC_SHA256 I was able to connect to IBMMQ queues. After changing to TLS_AES_256_GCM_SHA384 I get error:

Interop+OpenSsl+SslException: SSL Handshake failed with OpenSSL error - SSL_ERROR_SSL.
---> Interop+Crypto+OpenSslCryptographicException: error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate
   --- End of inner exception stack trace ---
   at Interop.OpenSsl.DoSslHandshake(SafeSslHandle context, ReadOnlySpan 1 input, Byte[]& sendBuf, Int32& sendCount)
   at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteSslContext& context, ReadOnlySpan 1 inputBuffer, Byte[]& outputBuffer, SslAuthenticationOptions sslAuthenticationOptions)
   --- End of inner exception stack trace ---
   at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)
   at System.Net.Security.SslStream.AuthenticateAsClient(SslClientAuthenticationOptions sslClientAuthenticationOptions)
   at System.Net.Security.SslStream.AuthenticateAsClient(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation)
   at IBM.WMQ.Nmqi.MQEncryptedSocket.MakeSecuredConnection()

Should I configure anything else? I will add that the app is on Linux, the connection that establishes from the .Net client is managed.

Openssl config:

CipherString = @SECLEVEL=1:kEECDH:kRSA:kEDH:kPSK:kDHEPSK:kECDHEPSK:-aDSS:-3DES:!DES:!RC4:!RC2:!IDEA:-SEED:!eNULL:!aNULL:!MD5:-SHA384:-CAMELLIA:-ARIA:-AESCCM8:AES256-SHA256:!ECDHE-RSA-AES256-GCM-SHA384:!AES256-GCM-SHA384:!AES128-SHA256

Ciphersuites = TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:TLS_AES_128_CCM_SHA256

TLS.MinProtocol = TLSv1.2
TLS.MaxProtocol = TLSv1.3

DTLS.MinProtocol = DTLSv1.2
DTLS.MaxProtocol = DTLSv1.2

SignatureAlgorithms = ECDSA+SHA256:ECDSA+SHA384:ECDSA+SHA512:ed25519:ed448:rsa_pss_pss_sha256:rsa_pss_rsae_sha256:rsa_pss_pss_sha384:rsa_pss_rsae_sha384:rsa_pss_pss_sha512:rsa_pss_rsae_sha512:RSA+SHA256:RSA+SHA384:RSA+SHA512:ECDSA+SHA224:RSA+SHA224:ECDSA+SHA1:RSA+SHA1sh-4

I am using IBMXMSDotnetClient version 9.3.2. The error I get after changing the cipher is :

2059 (080B) (RC2059): MQRC_Q_MGR_NOT_AVAILABLE.

When I use the old one on the server side, a cipher mismatch error is returned (without ssl error), i.e. it shows that I used TLS_RSA_WITH_AES_256_CBC_SHA256 when I should have used TLS_AES_256_GCM_SHA384.

Upvotes: 2

Views: 1100

Answers (2)

JoshMc
JoshMc

Reputation: 10662

According to the IANA site TLS_AES_256_GCM_SHA384 is HEX 0x13,0x02, commonly written 1302.

You do not mention the version of MQ running on the server but do state it did not support TLS1.3, v9.2 is when MQ started to support TLS1.3 so I'll assume 9.1 or lower.

According to the IBM MQ Enabling CipherSpecs page 1302 is not supported.

I suspect you really want the TLS1.2 cipher TLS_RSA_WITH_AES_256_GCM_SHA384 which is supported and is 009D.

According to this testssl.sh openssl mapping site

1302=openssl cipher TLS_AES_256_GCM_SHA384 which matches the IANA name TLS_AES_256_GCM_SHA384 and is what you specified.

009D=openssl cipher AES256-GCM-SHA384 which has the IANA name TLS_RSA_WITH_AES_256_GCM_SHA384 which matches what the IBM MQ queue manger would call it and supports as a TLS1.2 cipher.

I suggest you update your openssl to specify the TLS1.2 cipher AES256-GCM-SHA384 instead of the TLS1.3 cipher TLS_AES_256_GCM_SHA384.

Upvotes: 2

Logan Haas
Logan Haas

Reputation: 1

TLS_RSA_WITH_AES_256_CBC_SHA256 (equivalent to SSL_RSA_WITH_AES_256_CBC_SHA256, per IBM SDK documentation) is only available for the TLSv1.2 protocol.

TLS_AES_256_GCM_SHA384 only works for the TLSv1.3 protocol.

IBM SDK - Cipher Suites Documentation

So, I'd start by confirming that WAS accepts both TLSv1.3 and TLSv1.2 protocols*. If you're using tWAS, check the SSL config (that the app server deploying MQ is using) for the QoP settings. In the admin console, here's an example path:

Security -> SSL certificate and key management > SSL configurations > NodeDefaultSSLSettings > Quality of protection (QoP) settings

* Custom protocol lists were introduced in WASv8.5.5.21 and v9.0.5.11.

Upvotes: 0

Related Questions