0
votes

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

1
could you set the debugging level of org.apache.http.wire to debug and share the results? - Víctor Romero
Updated to show no trusted certificate stack - RLau
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

1 Answers

0
votes

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.