https://bz.apache.org/bugzilla/show_bug.cgi?id=70166

            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 there
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 WebSocket
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 = 
             ClientEndpointConfig.Builder.create();

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

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

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to