web stats
Mirth Community - View Single Post - Socket communications problems
View Single Post
  #1  
Old 07-11-2019, 07:29 AM
jolugarc jolugarc is offline
What's HL7?
 
Join Date: Sep 2015
Posts: 2
jolugarc is on a distinguished road
Default Socket communications problems





===== STAGE: I have two machines [ MAQUINA_1 <--- VPN ----> MAQUINA_2 ]:

-- In MAQUINA_1, I have installed a MIRTH server, and in MAQUINA_2 I have installed a MIRTH client application, and a web browser (Chrome), from

which I can connect to MIRTH server in MAQUINA_1 using a VPN.


-- In MAQUINA_2 I have others differents VPN to connect with others differents MIRTH servers, and in these cases the communications are correct

anyway.




===== PROBLEM: The problem is to connect to MIRTH server in MAQUINA_1 using socket. The issue is that I use a VPN to connect with MIRTH server and the

communication is correct using Chrome web browser, both HTTP and HTTPS URLs; and I can communicate correctly at "Web Dashboard Sign in" and the

"webstart.jnlp" file dowload fine.


Also works fine the API REST deployed by MIRTH server, wher I can authenticate the "admin" user and make calls to methods (for example:

'https://"92.168.100.75:8443/api/system/info" ).


- Next I show the URLs which the communication is correct through a web browser from MAQUINA_2.

-- http://192.168.100.75:8080/webadmin/Index.action
-- https://192.168.100.75:8443/webadmin/Index.action
-- https://192.168.100.75:8443/webadmin...tistics.action
-- https://192.168.100.75:8443/api/


- But when I try to open the MIRTH "Administrator" desktop application, that after authenticate the user "admin" appears the following alert:

<< There was en error connecting to the server at the specified address. Please verify that the server is up and running. >>

-- And the JAVA console logs show the following EXCPETION: << java.net.SocketTimeoutException: >>



===== DOUBTS: It seems that the communications through HTTP and HTTPS using Chromer web browser works fine, but not the communication al socket level.

-- The problem is a firewall, router or similar , that could be filtering the communications ?

-- The problem coulb be caused by certificate SSL ?




===== OTHER DATA AND LOGS: Next I show more detailed data.

================================================== ============================================

///////////////////// M┴QUINA_1:

- IP: 192.168.100.75

- Type: Virtual Machine

- Operating System: LINUX

$ lsb_release -a
---------------------------------------------------------
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 8.4 (jessie)
Release: 8.4
Codename: jessie
---------------------------------------------------------


- FIREWALLS:

/// TEST LINUX FIREWALL:

$ aptitude search ufw |grep "^i"
---------------------------------------------------------
---------------------------------------------------------


/// TEST IPTABLES CONFIGURATION:

$ aptitude search iptables|grep "^i"
---------------------------------------------------------
i iptables - administration tools for packet filtering
---------------------------------------------------------

$ sudo iptables -S
---------------------------------------------------------
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
---------------------------------------------------------



- JAVA: 7

$ java -version
-----------------------------------------------------------------------
java version "1.7.0_221"
OpenJDK Runtime Environment (IcedTea 2.6.18) (7u221-2.6.18-1~deb8u1)
OpenJDK 64-Bit Server VM (build 24.221-b02, mixed mode)
-----------------------------------------------------------------------


- POSTGRESQL: v.9.4.22

- MIRTH CONNECT SERVER: v.3.4.1.8057 <== "mcservice" is up and running.
- MIRTH CONNECT CLIENT: v.3.4.1.8057 <== Connect correctly with the local MIRTH server.

================================================== ============================================

//////////////////// M┴QUINA_2:

- IP_1: 192.168.253.145
- IP_2: 192.168.108.132 (asignada por la VPN)
- Type: netbook laptop
- Operating System: WINDOWS 7

- MIRTH CONNECT CLIENT: mirthconnectcli-3.4.1.8057.b139-windows-x64

- This machine contains other differents VPNs whith other differents MIRTH servers whith the same version v.3.4.1.8057, and all of them works correctly.

================================================== ============================================

//////////////////// VPN CONNECTION:

- I connect throught a VPN from MAQUINAJ_2 to MAQUINA_1.
- This VPN assigns to MAQUINA_2 this IP 192.168.108.132.
- I have rebooted MAQUINA_1, but the problem persists.



================================================== ============================================

/////////////////// CONNECTION THROUGH MIRTH CLIENT SHELL FROM MAQUINA_1:

$ mccommand -a https://192.168.100.75:8443 -u admin
-------------------------------------------------------------------------------------------------------------------

Connected to Mirth Connect server @ https://192.168.100.75:8443 (3.4.1.8057)
$STATUS
ID Status Name

$USER LIST
ID User Name Name Email
1 admin null null null null



================================================== ============================================


/////////////////// CONNECTION FROM MIRTH CLIENT SHELL FROM M┴QUINA_2:

C:\>java -jar mirth-cli-launcher.jar -a https://192.168.100.75 -u admin
-------------------------------------------------------------------------------------------------------------------

com.mirth.connect.client.core.ClientException: org.apache.http.conn.HttpHostConnectException: Connect to 192.168.100.75:443 [/192.168.100.75] failed:

Connectio
n refused: connect
at com.mirth.connect.client.core.ServerConnection.exe cuteSync(ServerConnection.java:221)
...
... 26 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(N ative Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Un known Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress( Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at org.apache.http.conn.ssl.SSLConnectionSocketFactor y.connectSocket(SSLConnectionSocketFactory.java:33 7)
at org.apache.http.impl.conn.DefaultHttpClientConnect ionOperator.connect(DefaultHttpClientConnectionOpe rator.java:134)
... 36 more

================================================== ============================================

/////////////////// CONNECTION THROUG MIRTH ADMINISTRATOR DESKTOP APPLICATION (USER AUTHENTICATION WINDOW)

-------------------------------------------
Server: https://192.168.100.75:8443
Username: admin
Password: *********
-------------------------------------------

- ALERT: << There was en error connecting to the server at the specified address. Please verify that the server is up and running. >>

- JAVA CONSOLE LOGS:

Java Web Start 11.121.2.13 x86
JRE 1.8.0_121-b13 Java HotSpot(TM) Client VM
----------------------------------------------------
CacheEntry[http://192.168.100.75:8080/webstart/...e-ncpdp.jnlp]: updateAvailable=true,lastModified=Wed Jul 10 14:14:57 CEST 2019,length=-1
com.mirth.connect.client.core.ClientException: org.apache.http.conn.ConnectTimeoutException: Connect to 192.168.100.75:8443 [/192.168.100.75] failed: Read

timed out
at com.mirth.connect.client.core.ServerConnection.exe cuteSync(ServerConnection.java:221)
...
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at sun.security.ssl.InputRecord.readFully(Unknown Source)
at sun.security.ssl.InputRecord.read(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHands hake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unkn own Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unkn own Source)
at org.apache.http.conn.ssl.SSLConnectionSocketFactor y.createLayeredSocket(SSLConnectionSocketFactory.j ava:394)
at org.apache.http.conn.ssl.SSLConnectionSocketFactor y.connectSocket(SSLConnectionSocketFactory.java:35 3)
at org.apache.http.impl.conn.DefaultHttpClientConnect ionOperator.connect(DefaultHttpClientConnectionOpe rator.java:134)
... 36 more

================================================== ============================================



























Reply With Quote