Announcement

Collapse
No announcement yet.

Mirth 3.4.1 - cannot connect to api

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

  • Mirth 3.4.1 - cannot connect to api

    When I try to access the Mirth REST API using this address: https://SERVER01:8443/api/

    ERROR in Chrome Browser:
    This site can’t be reached

    SERVER01 unexpectedly closed the connection.
    Try:
    Checking the connection
    Checking the proxy and the firewall
    Running Windows Network Diagnostics
    ERR_CONNECTION_CLOSED


    my other servers with the same version of mirth installed allow me to connect with no issues to the API.

    Has anyone encountered this? Is there a service that need to be started? If you have any ideas, please let me know

    Thanks in advance.
    Last edited by clarksss; 12-06-2016, 12:10 PM. Reason: showing url i am trying to access

  • #2
    Error connecting to MIRTH API

    Originally posted by clarksss View Post
    When I try to access the Mirth REST API using this address: https://SERVER01:8443/api/

    ERROR in Chrome Browser:
    This site can’t be reached

    SERVER01 unexpectedly closed the connection.
    Try:
    Checking the connection
    Checking the proxy and the firewall
    Running Windows Network Diagnostics
    ERR_CONNECTION_CLOSED


    my other servers with the same version of mirth installed allow me to connect with no issues to the API.

    Has anyone encountered this? Is there a service that need to be started? If you have any ideas, please let me know

    Thanks in advance.
    I am able to connect to other mirth server api's, just this one is not allowing me to connect? all servers have been setup the same and mirth installed using the same procedure.

    Does anyone have some ideas as to why I can't connect to this one mirth servers API?

    Thanks in advance !!

    Comment


    • #3
      It should open as expected in IE.
      HL7v2.7 Certified Control Specialist!

      Comment


      • #4
        Check the certificate in keystore.jks. If you've upgraded from an old version of MC, it's possible that the server cert in there is still a SHA-1 self-signed cert. That might explain why browsers are rejecting it. You can backup your keystore, remove the mirthconnect alias, and restart MC to have it auto-generate a new self-signed cert using SHA-256 instead.
        Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

        Nicholas Rupley
        Work: 949-237-6069
        Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


        - How do I foo?
        - You just bar.

        Comment


        • #5
          Mirth Connect – API Certificate upgrade (if using Java 1.7, do this... otherwise Java 1.8 works already and these steps are not needed)

          Copy these 2 folders to C:\Temp on the Mirth server that needs fixing:
          -portecle-1.9
          -UnlimitedJCEPolicy


          On Mirth server (create backup copies of some files)
          • browse to: C:\Program Files\Mirth Connect\appdata and make a copy of the keystore.jks (call it keystore.jks.bak)
          • browse to: C:\Program Files\Java\jre7\lib\security and make copies of local_policy.jar and US_export_policy.jar and rename them both to the filename.jar.bak
          Next, Stop the mirth Service (as it is using java)
          Now, go to C:\Temp\UnlimitedJCEPolicy and copy local_policy.jar and US_export_policy.jar files and over write the same 2 files located here: C:\Program Files\Java\jre7\lib\security (basically do a copy paste/replace)

          Next, run a command prompt (As Administrator) and run the following commands:
          • cd\
          • cd temp\portecle-1.9
          • java -jar portecle.jar
          Now from within portecle, browse to: C:\Program Files\Mirth Connect\appdata and open up the keystore.jks file… it will ask you for a password.
          Open up C:\Program Files\Mirth Connect\conf\mirth.properties with Notepad++ and copy the keystore.keypass for this mirth server, and paste it in the text box in portecle.
          If IIS is not installed on the mirth server, then install web server (in Programs and Features in windows OS) ** this is to create a 2056 bit encrypted server certificate needed to run mirth/java api **
          Select all defaults when installing the Web Server (IIS) feature.
          Once you can browse to IIS, create a Self Signed Certificate and ensure you change the type from “personal” to “ Web Hosting”. Label the friendly name as the DNS Alias of the server. Eg: MirthWebServer

          After the cert is created, Export it and save it to C:\Temp (save as the DNS alias of the server)
          Once the file is exported, go back into the portecle (you should see encryption and mirthconnect certs) and delete the mirthconnect cert. Now click on Tools and select Import Key Pair… select the newly exported file you created (DNS alias .pfx)
          Enter the Alias as mirthconnect and use the original keystore.keypass password as per above
          Then save the keystore file and close portecle.
          Uninstall IIS if you wish.

          Troubleshooting
          If you get an error similar to this: http://blog.infusiontechsolutions.co...s-type-pkcs12/
          Resolution: close off portecle and ensure all references to Java have been killed then load up portecle and try again.

          Comment


          • #6
            thanks

            Originally posted by narupley View Post
            Check the certificate in keystore.jks. If you've upgraded from an old version of MC, it's possible that the server cert in there is still a SHA-1 self-signed cert. That might explain why browsers are rejecting it. You can backup your keystore, remove the mirthconnect alias, and restart MC to have it auto-generate a new self-signed cert using SHA-256 instead.
            I have not tried this, but looks to be a lot simpler than what i had done to solve the issue... i will try your suggestion on another one of our mirth servers.

            UPDATE: i have tested this out and it works like a charm! way faster.. thanks !!!

            thanks.
            Last edited by clarksss; 04-19-2017, 09:26 AM.

            Comment


            • #7
              I am also trying to connect to REST API but getting the error below. What is causing this issue and how to resolve it? Will the above solution also work for my issue.

              javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
              at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocke tImpl.java:953)
              at sun.security.ssl.SSLSocketImpl.performInitialHands hake(SSLSocketImpl.java:1332)
              at sun.security.ssl.SSLSocketImpl.startHandshake(SSLS ocketImpl.java:1359)
              at sun.security.ssl.SSLSocketImpl.startHandshake(SSLS ocketImpl.java:1343)
              at com.linoma.httpclient.conn.ssl.SSLConnectionSocket Factory.createLayeredSocket(Unknown Source)
              at com.linoma.httpclient.conn.ssl.SSLConnectionSocket Factory.connectSocket(Unknown Source)
              at com.linoma.httpclient.impl.conn.DefaultHttpClientC onnectionOperator.connect(Unknown Source)
              at com.linoma.httpclient.impl.conn.PoolingHttpClientC onnectionManager.connect(Unknown Source)
              at com.linoma.httpclient.impl.execchain.MainClientExe c.establishRoute(Unknown Source)
              at com.linoma.httpclient.impl.execchain.MainClientExe c.execute(Unknown Source)
              at com.linoma.httpclient.impl.execchain.ProtocolExec. execute(Unknown Source)
              at com.linoma.httpclient.impl.execchain.RetryExec.exe cute(Unknown Source)
              at com.linoma.httpclient.impl.execchain.RedirectExec. execute(Unknown Source)
              at com.linoma.httpclient.impl.client.InternalHttpClie nt.doExecute(Unknown Source)
              at com.linoma.httpclient.impl.client.CloseableHttpCli ent.execute(Unknown Source)
              at com.linoma.httpclient.impl.client.CloseableHttpCli ent.execute(Unknown Source)
              at com.linoma.httpclient.impl.client.CloseableHttpCli ent.execute(Unknown Source)
              at com.linoma.ga.projects.resources.RESTResource.test (Unknown Source)
              at com.linoma.ga.projects.resources.ResourceTester.su bmitParameters(Unknown Source)
              at sun.reflect.GeneratedMethodAccessor3097.invoke(Unk nown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at org.apache.el.parser.AstValue.invoke(AstValue.java :278)
              at org.apache.el.MethodExpressionImpl.invoke(MethodEx pressionImpl.java:273)
              at org.apache.myfaces.view.facelets.el.ContextAwareTa gMethodExpression.invoke(ContextAwareTagMethodExpr ession.java:96)
              at org.apache.myfaces.application.ActionListenerImpl. processAction(ActionListenerImpl.java:74)
              at org.primefaces.application.DialogActionListener.pr ocessAction(DialogActionListener.java:45)
              at javax.faces.component.UICommand.broadcast(UIComman d.java:120)
              at javax.faces.component.UIViewRoot._broadcastAll(UIV iewRoot.java:1172)
              at javax.faces.component.UIViewRoot.broadcastEvents(U IViewRoot.java:365)
              at javax.faces.component.UIViewRoot._process(UIViewRo ot.java:1658)
              at javax.faces.component.UIViewRoot.processApplicatio n(UIViewRoot.java:862)
              at org.apache.myfaces.lifecycle.InvokeApplicationExec utor.execute(InvokeApplicationExecutor.java:42)
              at org.apache.myfaces.lifecycle.LifecycleImpl.execute Phase(LifecycleImpl.java:196)
              at org.apache.myfaces.lifecycle.LifecycleImpl.execute (LifecycleImpl.java:143)
              at javax.faces.webapp.FacesServlet.service(FacesServl et.java:198)
              at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:303)
              at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:208)
              at com.linoma.ga.core.upload.FileUploadFilter.doFilte r(Unknown Source)
              at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:241)
              at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:208)
              at org.apache.tomcat.websocket.server.WsFilter.doFilt er(WsFilter.java:52)
              at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:241)
              at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:208)
              at com.linoma.dpa.security.SecurityFilter.doFilter(Un known Source)
              at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:241)
              at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:208)
              at com.linoma.ga.ui.core.filter.IFrameEmbeddingFilter .doFilter(Unknown Source)
              at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:241)
              at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:208)
              at com.linoma.ga.ui.core.filter.NoCacheFilter.doFilte r(Unknown Source)
              at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:241)
              at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:208)
              at com.linoma.ga.ui.core.filter.IECompatibilityModeFi lter.doFilter(Unknown Source)
              at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:241)
              at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:208)
              at com.linoma.dpa.j2ee.AdminRedirectFilter.doFilter(U nknown Source)
              at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:241)
              at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:208)
              at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:220)
              at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:122)
              at org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:503)
              at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:170)
              at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:103)
              at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:116)
              at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:421)
              at org.apache.coyote.http11.AbstractHttp11Processor.p rocess(AbstractHttp11Processor.java:1070)
              at org.apache.coyote.AbstractProtocol$AbstractConnect ionHandler.process(AbstractProtocol.java:611)
              at org.apache.tomcat.util.net.JIoEndpoint$SocketProce ssor.run(JIoEndpoint.java:316)
              at java.util.concurrent.ThreadPoolExecutor.runWorker( ThreadPoolExecutor.java:1145)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:615)
              at org.apache.tomcat.util.threads.TaskThread$Wrapping Runnable.run(TaskThread.java:61)
              at java.lang.Thread.run(Thread.java:745)
              Caused by: java.io.EOFException: SSL peer shut down incorrectly
              at sun.security.ssl.InputRecord.read(InputRecord.java :482)
              at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocke tImpl.java:934)
              ... 72 more

              Comment

              Working...
              X