Reputation: 11
I am developing a rest webservice in mule using inbound https endpoint.I have configured the https connector with the tls-key-store and tls-server.(Have generated the same using keytool).
Below is the configuration file :
<https:connector name="httpsConnector" doc:name="HTTP\HTTPS" validateConnections="true">
<https:tls-key-store path="keystore.jks" keyPassword="welcome" storePassword="welcome"/>
<https:tls-server path="truststore.jks" storePassword="welcome"/>
</https:connector>
<flow name="RESTFlow1" doc:name="RESTFlow1">
<https:inbound-endpoint exchange-pattern="request-response" host="0.0.0.0" port="8082" connector-ref="httpsConnector" doc:name="HTTPS"/>
<jersey:resources doc:name="REST">
<component class="com.thinxtream.rest.restWebservices"/>
</jersey:resources>
</flow>
The client is a flex application which connects to this mule rest webservice,Its giving the below error:
httpsConnector.receiver.02] org.mule.exception.DefaultSystemExceptionStrategy: Caught exception in Exception Strategy: Received fatal alert: bad_certificate
javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
at sun.security.ssl.AppInputStream.read(Unknown Source)
at sun.security.ssl.AppInputStream.read(Unknown Source)
at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
at org.mule.transport.http.HttpServerConnection.readLine(HttpServerConnection.java:219)
at org.mule.transport.http.HttpServerConnection.readRequest(HttpServerConnection.java:185)
at org.mule.transport.http.HttpMessageReceiver$HttpWorker.run(HttpMessageReceiver.java:155)
at org.mule.work.WorkerContext.run(WorkerContext.java:311)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Does it any configuration on the flex application also ?
Upvotes: 0
Views: 485
Reputation: 6853
IF you created the server side certificate yourself then it is probably self-signed or signed with a CA certificate of your own. The client needs to trust the signing certificate or the server certificate itself. For that to work you need to import the server certificate (chain) into the truststore that the client uses.
Upvotes: 1