2 Replies Latest reply on Dec 7, 2017 12:31 AM by Sidhdesh Punaskar

    Use proxy server to send APNS notification

    Sidhdesh Punaskar

      MyIT 3.3

       

      APNS notification are not reaching to myit app after we change the status of service. In UC, we get the notification.

       

      In ux logs we get below error.

      00:00:05.839 | ification thread in QUEUE mode | RID: none | ERROR   | c.b.b.m.s.p.a.APNSNotificationProgressListener | Critical exception in notification thread '1'!

      00:00:05.842 | ification thread in QUEUE mode | RID: none | ERROR   | c.b.b.m.s.p.a.APNSNotificationProgressListener | Exception is:

      javapns.communication.exceptions.CommunicationException: Communication exception: java.net.ConnectException: Connection timed out: connect

       

      We understand the problem is with firewall and ports (5223 and 2195) need to be opened as per apple docs.

      https://developer.apple.com/library/content/technotes/tn2265/_index.html#//apple_ref/doc/uid/DTS40010376-CH1-TNTAG44

       

      $ telnet 1-courier.push.apple.com 5223

      $ telnet gateway.sandbox.push.apple.com 2195

      $ telnet gateway.push.apple.com 2195

       

      We know the problem would be resolved by opening the port but customer does not want to open the ports.

       

      Question: How can we use proxy or add proxy server in myit tomcat configuration so that APNS will be sent to proxy and then communicate to apple.

       

      Anyone has done this?

       

      We tried below:

      1) https://tomcat.apache.org/tomcat-8.0-doc/proxy-howto.html

       

      We added the connector tag in web.xml file under Program Files\BMC Software\Smart_IT_MyIT\Smart_IT_MyIT\ux\WEB-INF

      <Connector port="8081" ...

      proxyName="www.mycompany.com"

      proxyPort="80"/>

       

       

      2) Also tried  another option to added below parameters in catalina.bat file

       

      set JAVA_OPTS=%JAVA_OPTS% "-Dhttps.proxySet=true"
      set JAVA_OPTS=%JAVA_OPTS% "-Dhttps.proxyHost=IP"
      set JAVA_OPTS=%JAVA_OPTS% "-Dhttps.proxyPort=8080"

      https://stackoverflow.com/questions/12309800/tomcat-and-proxy-settings

       

       

      Sidhdesh

        • 1. Re: Use proxy server to send APNS notification
          Sidhdesh Punaskar

          we now able to reach proxy but the notifications are not reaching to apple.

           

          We did below:

          Open the SmartITMyITTomcat8w.exe in tomcat\bin folder and then add following lines in the Java Options text area of Java tab. Please see the attached screenshot.

           

          -Dhttp.proxySet=true"

          -Dhttp.proxyHost=IP"

          -Dhttp.proxyPort=8080"

          -Dhttps.proxySet=true"

          -Dhttps.proxyHost=IP"

          -Dhttps.proxyPort=8080"

           

          Any further suggestion?

           

          Sidhdesh

          • 2. Re: Use proxy server to send APNS notification
            Sidhdesh Punaskar

            Solution:

            in the SmartITMyITTomcat8w.exe (at the end of Java options):
            -Dhttp.proxySet=true
            -Dhttp.proxyHost=XXXXX
            -Dhttp.proxyPort=3128
            -Dhttps.proxySet=true
            -Dhttps.proxyHost=XXXXXX
            -Dhttps.proxyPort=3128

            in the catalina.bat (after ":noJuliConfig"):

            export JAVA_OPTS=”$JAVA_OPTS -Dhttp.proxyexport=true
            export JAVA_OPTS=”$JAVA_OPTS -Dhttp.proxyHost=XXXXXX
            export JAVA_OPTS=”$JAVA_OPTS -Dhttp.proxyPort=3128

            export JAVA_OPTS=”$JAVA_OPTS -Dhttps.proxyexport=true
            export JAVA_OPTS=”$JAVA_OPTS -Dhttps.proxyHost=XXXXXX
            export JAVA_OPTS=”$JAVA_OPTS -Dhttps.proxyPort=3128