Monday, May 11, 2015

Reason for 'javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?' while working with WSO2 products

While configuring WSO2 API manage to work with WSO2 IS as the Auth Manager, while trying to login to API Store/API Publisher, noticed the following exception.


javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection? at com.sun.net.ssl.internal.ssl.InputRecord.handleUnknownRecord(Unknown Source) at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source) at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source) at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source) The reason for this was that we have configured a HTTP port for an HTTPS URL.

  E.g.:-
<authmanager>
        <!--
            Server URL of the Authentication service
        -->
        <serverurl>https://localhost:9763/services/</serverurl>
        <!--
            Admin username for the Authentication manager.
        -->
        <username>admin</username>
        <!--
            Admin password for the Authentication manager.
        -->
        <password>admin</password>
    </authmanager>