web stats
Call Web Service with HTTPS - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-21-2012, 07:10 AM
chris_k chris_k is offline
OBX.1 Kenobi
 
Join Date: Jan 2012
Location: Austria
Posts: 27
chris_k is on a distinguished road
Post Call Web Service with HTTPS

Hi everyone,

I have a question about web services.
I have to call a web service which is only available with the https-protocol.
I'm using the Mirth Connect Community edition (2.2.1) and I read in another thread that the community edition didn't provide this transfer protocol.

I always get the error message, 'Unsupported endpoint address:'.
I tested the channels with a webservice with a http-url and I tested the https-web services with soap-ui. So the channels and the web service are ok.

Is it possible within Mirth to call a web service via http, if he requires https?

thanks,
chris
Reply With Quote
  #2  
Old 03-21-2012, 07:45 AM
ironbridge ironbridge is offline
OBX.1 Kenobi
 
Join Date: Jul 2011
Location: Pittsburgh, Pa
Posts: 33
ironbridge is on a distinguished road
Default

Hi Chris,
I've successfully called https web services, but had to use java.net.URL in my javascript transformer to do it. Check out my post from a while ago and let me know if you have any questions:
http://www.mirthcorp.com/community/f...ead.php?t=6084
Reply With Quote
  #3  
Old 03-21-2012, 07:58 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 3,527
narupley is on a distinguished road
Default

You can send TCP messages manually as ironbridge has pointed out, or you can use an tunnel to handle all SSL traffic automatically for you. Mirth Appliances have a service built in and Mirth provides a plugin for gold support clients, but otherwise, you can use literally any ol' program; stunnel is a popular one. Doing it that way, not only do you have all of your security encapsulated in a separate layer, but also, you can use any inbound/outbound connectors in Mirth without having to come up with a JavaScript workaround for sending messages over TCP. From the perspective of Mirth, it's as if you're connecting to the remote client/sever without any security layer at all (which is also true if you're using a VPN to connect, etc.).
Reply With Quote
  #4  
Old 04-02-2012, 12:35 AM
chris_k chris_k is offline
OBX.1 Kenobi
 
Join Date: Jan 2012
Location: Austria
Posts: 27
chris_k is on a distinguished road
Default

Hi,

thanks (again) for help your narupley and ironbridge.

I'm talk with my administrator and we build up a proxy. Mirth sends the web service call to this proxy via http and he forwards the call via https to the external web service.
It's no problem for Mirth to get the Service, the port and the envelope from the wsdl url.
I receive the response from the web service call with a new channel with a channel reader. I have a sender and a receiver channel.

If I try this two channels, the sender channel returns the error message
"HTTP transport error: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake".

I didn't understand how there could be an error like this. Because my administrator uses stunnel for the connection between the proxy and the external web service and as far as I know, stunnel (should) remove the secure header part of the message.

Can someone of you help me?
With SOAP-UI it works fine, without problems.

thanks ironbridge for your link, but I didn't understand how I could manage the wsdl with the service, the port and the soap-operation in Javascript?
Maybe you could explain it to me.

thanks.

Last edited by chris_k; 04-02-2012 at 12:39 AM.
Reply With Quote
  #5  
Old 04-02-2012, 05:17 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 3,527
narupley is on a distinguished road
Default

Quote:
Originally Posted by chris_k View Post
Hi,

thanks (again) for help your narupley and ironbridge.

I'm talk with my administrator and we build up a proxy. Mirth sends the web service call to this proxy via http and he forwards the call via https to the external web service.
It's no problem for Mirth to get the Service, the port and the envelope from the wsdl url.
I receive the response from the web service call with a new channel with a channel reader. I have a sender and a receiver channel.

If I try this two channels, the sender channel returns the error message
"HTTP transport error: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake".

I didn't understand how there could be an error like this. Because my administrator uses stunnel for the connection between the proxy and the external web service and as far as I know, stunnel (should) remove the secure header part of the message.

Can someone of you help me?
With SOAP-UI it works fine, without problems.

thanks ironbridge for your link, but I didn't understand how I could manage the wsdl with the service, the port and the soap-operation in Javascript?
Maybe you could explain it to me.

thanks.
I'm confused by your wording; let me see if I got this right:
  1. You have a Web Service Sender channel that by itself works just fine, through the proxy and everything.
  2. When you choose a channel in the "Send Response To" drop-down box, all of the sudden your channel stops working and your TLS layer breaks down.

Does that sound right?
Reply With Quote
  #6  
Old 04-02-2012, 07:00 AM
chris_k chris_k is offline
OBX.1 Kenobi
 
Join Date: Jan 2012
Location: Austria
Posts: 27
chris_k is on a distinguished road
Default

No, you didn't understand.
The Web service sender channel doesn't work with or without a response channel.

If I start the channel (source js-reader) and it calls the web service I got the error message.
With soap-ui the web services works fine, with Mirth not.
I think there could be a problem with the proxy in the middle of Mirth and the external web service.

mirth and the proxy communicates via http.
the proxy and the external web service communicates via https.
the proxy is just used to provide the wsdl from the external web service to mirth with http.

i used the channels from your post last month to call the web services.
i just change the destination.

http://www.mirthcorp.com/community/f...ht=web+service

with other web services without needed https it works without problems.


thanks for help again
Reply With Quote
  #7  
Old 04-02-2012, 07:13 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 3,527
narupley is on a distinguished road
Default

Quote:
Originally Posted by chris_k View Post
No, you didn't understand.
The Web service sender channel doesn't work with or without a response channel.

If I start the channel (source js-reader) and it calls the web service I got the error message.
With soap-ui the web services works fine, with Mirth not.
I think there could be a problem with the proxy in the middle of Mirth and the external web service.

mirth and the proxy communicates via http.
the proxy and the external web service communicates via https.
the proxy is just used to provide the wsdl from the external web service to mirth with http.

i used the channels from your post last month to call the web services.
i just change the destination.

http://www.mirthcorp.com/community/f...ht=web+service

with other web services without needed https it works without problems.


thanks for help again
I'm trying to figure out why you would have seen the javax.net.ssl exception; that wouldn't have come from stunnel I don't think. Are you using the SSL Manager in Mirth?
Reply With Quote
  #8  
Old 04-03-2012, 12:14 AM
chris_k chris_k is offline
OBX.1 Kenobi
 
Join Date: Jan 2012
Location: Austria
Posts: 27
chris_k is on a distinguished road
Default

Not to my knowledge, but I use the mirth connect community edition.
The ssl manager is just a plug-in for supported editions, is this correct?

I didn't see the ssl manager in my mirth instance, and I didn't work ever before with the ssl manager.

I also import the certificate from the server of the external web service into the java cacerts and the truststore of mirth connect.
I set the java_home environment variable to my java directory.

a few minutes ago I've imported this certificates again, I've created the java_home also again,
I've started the same mirth channels, and I've got a new error message
"HTTP transport error: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?".

Last edited by chris_k; 04-03-2012 at 12:25 AM.
Reply With Quote
  #9  
Old 04-03-2012, 06:12 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 3,527
narupley is on a distinguished road
Default

Quote:
Originally Posted by chris_k View Post
Not to my knowledge, but I use the mirth connect community edition.
The ssl manager is just a plug-in for supported editions, is this correct?

I didn't see the ssl manager in my mirth instance, and I didn't work ever before with the ssl manager.

I also import the certificate from the server of the external web service into the java cacerts and the truststore of mirth connect.
I set the java_home environment variable to my java directory.

a few minutes ago I've imported this certificates again, I've created the java_home also again,
I've started the same mirth channels, and I've got a new error message
"HTTP transport error: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?".
Try taking it out of the Mirth truststore; after all, you don't need it in Mirth, since your external daemon handles the SSL. Also, make sure your URL is using http:// rather than https://. Other than that, I'm not sure, since there are a lot of variables there (what the server is expecting, what your "proxy" is actually doing, etc.).
Reply With Quote
  #10  
Old 04-03-2012, 07:11 AM
chris_k chris_k is offline
OBX.1 Kenobi
 
Join Date: Jan 2012
Location: Austria
Posts: 27
chris_k is on a distinguished road
Default

I'm sure, that I use the url with http.

I'm going to talk with the administrator to take a look on the communication between the tree endpoints (mirth, proxy, web service) with wireshark. To check the function of the proxy and stunnel.

I know, there could be high number of reasons for this problem.
But I think Mirth is running correct and the proxy make a mistake at the call or at the response.

thanks for help
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:53 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Mirth Corporation