Bluemix assigned the url .mybluemix.net to my application, denoted . However, when I put the url "https://.mybluemix.net" in the browser, I get an error because the certificate is for .ng.mybluemix.net, not .mybluemix.net! The error is denoted by a red line through the "https" portion of the url.
When I try to open a connection to "https://.mybluemix.net" in Java code, the following exception is thrown: Exception in thread "main" javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative DNS name matching .mybluemix.net found. at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1884) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:276) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:270) at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1341) at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:153) at sun.security.ssl.Handshaker.processLoop(Handshaker.java:868) at sun.security.ssl.Handshaker.process_record(Handshaker.java:804) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1016) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323) at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:153) at com.ibm.wait.stacks.uploader.Uploader.establishSession(Uploader.java:150) at com.ibm.wait.stacks.uploader.Uploader.upload(Uploader.java:245) at com.ibm.wait.stacks.uploader.Uploader.main(Uploader.java:329)
This seems like a bug. The certificate does not match the url's that bluemix assigns.
Let may application be named "myApp". Bluemix assigns the url "myapp.mybluemix.net". https://myapp.mybluemix.net has a certificate for "*.ng.mybluemix.net", which does not certify the URL!
Using Java code to open a HttpURLConnection to "myApp.mybluemix.net" results in a "javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative DNS name matching myApp.mybluemix.net found" exception being thrown.
In my original post, I used angle brackets in the pseudo application name, which resulted in the name being dropped, making my example unreadable.