[Bug 70166] New: web-socket-howto has dropped SSLContext configuration

[email protected] Fri, 31 Jul 2026 18:20:21 +0000
Newsgroups gmane.comp.jakarta.tomcat.devel
Message-ID <[email protected]/bugzilla/>
https://bz.apache.org/bugzilla/show_bug.cgi?id=3D70166

            Bug ID: 70166
           Summary: web-socket-howto has dropped SSLContext configuration
           Product: Tomcat 11
           Version: 11.0.24
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Documentation
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: -------

The WS-HowTo 10.1 tells the old userProperties method, and mentions that th=
ere
is a new method, but does not show it.  The 11.0 document tells nothing of
programmed SSLContext handling.


An illustrative method for programmed setting of custom SSLContext on WebSo=
cket
client follows:


  import static
org.apache.tomcat.websocket.Constants.WS_AUTHENTICATION_USER_NAME;
  import static
org.apache.tomcat.websocket.Constants.WS_AUTHENTICATION_PASSWORD;

  final ClientEndpointConfig.Builder builder =3D=20
             ClientEndpointConfig.Builder.create();

  final SSLContext sslContext =3D . . ; // get it from somewhere
  builder.sslContext(sslContext);

  // This is the shared end-point configuration, store and share it
  ClientEndpointConfig config =3D builder.build();

  // Optionally add userProperties, like following
  final Map<String,Object> userProperties =3D this.config.getUserProperties=
();
  userProperties.put(WS_AUTHENTICATION_USER_NAME, this.clientusername);
  userProperties.put(WS_AUTHENTICATION_PASSWORD,  this.clientpassword);

--=20
You are receiving this mail because:
You are the assignee for the bug.=