error during websocket handshake: unexpected response code: 500

Rvdh Vento 0 Reputation points
2023-08-03T08:26:06.84+00:00

Hi all!

We are having issues trying to connect to our onprem application through an azure application proxy. We can see in console view (while inspecting the page) that we are having this error:

websocket connection to failed: error during websocket handshake: unexpected response code: 500 reconnectingwebsocket.open @ reconnecting-websocket.js azure application proxy

We are connecting to a Tomcat webservice.

Anyone else has got this problem or anyone know the solution to this?

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
24,194 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Marilee Turscak-MSFT 37,181 Reputation points Microsoft Employee
    2023-08-04T20:25:10.6533333+00:00

    @Rvdh Vento ,

    I understand that you are receiving the following error:

    websocket connection to failed: error during websocket handshake: unexpected response code: 500 reconnectingwebsocket.open @ reconnecting-websocket.js azure application proxy

    If the application is accessible when bypassing the Azure AD application proxy, it's possible that the backend server certificate has expired. The websocket connection may fail and fall back to http, causing slow connection over http. If you renew/replace the certificate, it should work again.

    If you are able to collect Fiddler data using -ServiceTraceOn , it will be easier to isolate the issue.

    I would also recommend checking the troubleshooting in this thread and this thread. If you try these steps and still face this issue, feel free to send me an email at AzCommunity@microsoft.com ("Attn: Marilee Turscak") and include your subscription ID and a link to this thread, and I can open a support case to help resolve your issue.

    If the information helped you, please Accept the answer. This will help us as well as others in the community who may be researching similar issues. Otherwise let me know if you have further questions.

    0 comments No comments

  2. Rvdh Vento 0 Reputation points
    2023-08-07T09:08:54.2133333+00:00

    Thank you for the response! Much appreciated.

    After some investigation with Fiddler, we got this:

        <h1>HTTP Status 500 – Internal Server Error</h1>
    
        <hr class="line" />
    
        <p><b>Type</b> Exception Report</p>
    
        <p><b>Message</b> No or empty origin header</p>
    
        <p><b>Description</b> The server encountered an unexpected condition that prevented it from fulfilling the request.
    
        </p>
    
        <p><b>Exception</b></p>
    
        <pre>java.lang.IllegalArgumentException: No or empty origin header
    

    Any idea what to do next?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.