websocket problem error wss:// URI's are not supported in this configuration
search cancel

websocket problem error wss:// URI's are not supported in this configuration

book

Article ID: 377230

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

Issues with websocket connections from API Gateway using ssl .

The websocket connection to Api Gateway fails though and ssg log shows following error:

2024-09-13T11:30:10.105+0200 INFO    341063 com.l7tech.external.assertions.websocket.server.WebSocketOutboundHandler: Attempting to create WebSocket connection to: wss://examplewebsocketserver.com:443
2024-09-13T11:30:10.105+0200 WARNING 341063 com.l7tech.external.assertions.websocket.server.SSGInboundWebSocket: Failed to create connection to the server for websocket id=6a9f4b27434a4e63c981befed1592dbd:13:HTTP/1.1. Reason:java.lang.IllegalStateException: HttpClient has no SslContextFactory, wss:// URI's are not supported in this configuration

Why do we get the error - what does it mean "wss:// URI's are not supported in this configuration" ... ?

Resolution

The Error indicate the connection expect ssl but it is not enabled in the connection details for the connection .

Do  the following to enable ssl for the websocket connection:

SSL Example for websockets connection details 

  • Create new websocket listening port:  Tasks/Extension and Add-On/Manage Websocket Connections
  • For Outbound tab, URL: wss://echo.websocket.org:443
  • Set checkbox: Use SSL.
  • From Tasks/Certificates/Manage Certificates click Add. 
  • Retrieve via SSL Connection: https://websocket.org:443.  Click Next.  Select Outbound SSL Connections .  Click Next and set checkbox: Certificate is a Trust Anchor.
  • Also the websockets server needs to trust the gateway private key which is selected in the ssl details .