0

I am trying to create a RESTful service within Mule using a File connector as an inbound endpoint, when a file is present this should then be pushed to an HTTPS endpoint. Using the question below as a starting point I have tried to follow this method. There are no exceptions returned and the file does not transfer.

How to upload multiple files via REST over HTTP using Mule?

Within this question there was a comment regarding the content type not being set, i had the same issue but for the purposes of my testing i have tried to push a text file through.

    <file:connector name="File" autoDelete="false" streaming="true" validateConnections="true" doc:name="File"/>
    <https:connector name="HTTP_HTTPS" cookieSpec="netscape" validateConnections="true" sendBufferSize="0" receiveBufferSize="0" receiveBacklog="0" clientSoTimeout="10000" serverSoTimeout="10000" socketSoLinger="0" doc:name="HTTP-HTTPS">
        <https:tls-key-store path="keystore.jks" keyPassword="PASS" storePassword="PASS"/>
        <https:tls-server path="nr_up_truststore.ts" storePassword="PASS"/>
    </https:connector>
    <flow name="Flow1" doc:name="Flow1">
        <file:inbound-endpoint path="Path" responseTimeout="10000" doc:name="File" connector-ref="File" disableTransportTransformer="true">
            <file:filename-regex-filter pattern="file(.*).txt" caseSensitive="false"/>
        </file:inbound-endpoint>
        <object-to-byte-array-transformer encoding="ISO-8859-5" doc:name="Object to Byte Array"/>
        <https:outbound-endpoint exchange-pattern="request-response" host="host" port="443"  method="POST"   doc:name="HTTP" connector-ref="HTTP_HTTPS" path="PATH" mimeType="text/plain" password="PASS" user="USER"/>
    </flow>

With following exception stack

Exception stack is: 1. No trusted certificate found (sun.security.validator.ValidatorException) sun.security.validator.SimpleValidator:-1 (null) 2. sun.security.validator.ValidatorException: No trusted certificate found (javax.net.ssl.SSLHandshakeException) sun.security.ssl.Alerts:-1 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/net/ssl/SSLHandshakeException.html) 3. Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=https://:@URL, connector-HttpsConnector

Community
  • 1
  • 1
RLau
  • 11
  • 5
  • 1
    could you set the debugging level of org.apache.http.wire to debug and share the results? – Víctor Romero Dec 15 '14 at 17:47
  • Updated to show no trusted certificate stack – RLau Dec 16 '14 at 10:25
  • In order to try create an SSL connection i first created a keytool, then exported to a client store certificate and finally created a truststore using the client cert. – RLau Dec 16 '14 at 11:01

1 Answers1

0

You don't have the certificate set up in your local keychain.

The command line tools are very difficult and TLS/SSL is a complex matter. I do suggest you use a graphical tool like key store explorer to download the certificate of the site and create a java keystore with it.

Víctor Romero
  • 5,107
  • 2
  • 22
  • 32
  • thanks for the suggestion, i have attempted to create a keystore this way and imported the SSL cert from the site i am now receive the following stack Exception stack is: 1. No X509TrustManager implementation available (java.security.cert.CertificateException) sun.security.ssl.DummyX509TrustManager:-1 (null) 2. java.security.cert.CertificateException: No X509TrustManager implementation available (javax.net.ssl.SSLHandshakeException) sun.security.ssl.Alerts:-1 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/net/ssl/SSLHandshakeException.html) – RLau Dec 17 '14 at 13:59