Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-414

connectToServer throws IllegalArgumentException when connecting to WSS

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • None
    • 1.2.0.Beta10
    • Servlet
    • None

      Using the following code to connect to a server:

              WebSocketContainer container = ContainerProvider.getWebSocketContainer();
      
              Session connected = container.connectToServer(
                      new Endpoint() {
                          @Override
                          public void onOpen(Session session, EndpointConfig endpointConfig) {
                              System.out.println("connected");
                          }
                      },
                      ClientEndpointConfig.Builder.create().build(),
                      new URI("wss://echo.websocket.org"));
          }
      

      I am getting this execption:

      Exception in thread "main" java.lang.IllegalArgumentException: XNIO000100: 'https' URL scheme chosen but no SSL provider given
      	at org.xnio.http.HttpUpgrade$HttpUpgradeState.doUpgrade(HttpUpgrade.java:253)
      	at org.xnio.http.HttpUpgrade$HttpUpgradeState.access$100(HttpUpgrade.java:165)
      	at org.xnio.http.HttpUpgrade.performUpgrade(HttpUpgrade.java:129)
      	at io.undertow.websockets.client.WebSocketClient$ConnectionBuilder.connect(WebSocketClient.java:214)
      	at io.undertow.websockets.jsr.ServerWebSocketContainer.connectToServer(ServerWebSocketContainer.java:204)
      	at Test.main(Test.java:22)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:483)
      

      Does the JSR API require a user to set a SSL provider, when using wss schema ?

              sdouglas1@redhat.com Stuart Douglas (Inactive)
              mwessend@redhat.com Matthias Wessendorf
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: