SCRAM-SHA-1 mongodb authentication using SOAP UI grrovy
I am trying to write a script for connecting mongodb on the server using groovy, MongoDB uses 'SCRAM-SHA-1' auth mechanism, application is in SSL mode. I have imported key strokes in VM options file, SSL settings in preference. Code is executable in eclipse successfully but failing in ReadyAPI.
getting following error
com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=UNKNOWN, servers=[{address=xx.xx.xx.xx, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketWriteException: Exception sending message}, caused by {javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names present}, caused by {java.security.cert.CertificateException: No subject alternative names present}}] error at line: 28.
Any suggestions.
Finally I got a solution by using MongoClientOptions
(MongoClientOptions.builder().sslEnabled(true).sslInvalidHostNameAllowed(true).build())