Announcement

Collapse
No announcement yet.

Socket communications problems

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

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




























  • #2
    In your CONNECTION FROM MIRTH CLIENT SHELL FROM MÁQUINA_2 section, you did not specify the port (at least in the example you posted.)

    Both the GUI and CLI admin client communicate with the server using the REST API, so if it works in a browser from that workstation, the admin clients should work as well.

    Are you able to install the new(ish) Admin Launcher on MÁQUINA_2 and test that? It's generally the preferred way to connect now as it does not rely on Java Web Start.

    See this thread for details: https://www.mirthcorp.com/community/...d.php?t=218662

    Comment


    • #3
      - The correct call was:

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

      But the result is the same.


      - The problem is now solved and the cause was a firewall, that was interpreting the MIRTH's client call as a threat.

      Thank you very much for your quick answer.

      Comment

      Working...
      X