tomcat.start();
WebSocketContainer wsContainer =
ContainerProvider.getWebSocketContainer();
ClientEndpointConfig clientEndpointConfig =
ClientEndpointConfig.Builder.create().build();
URL truststoreUrl = this.getClass().getClassLoader().getResource(
"org/apache/tomcat/util/net/ca.jks");
File truststoreFile = new File(truststoreUrl.toURI());
clientEndpointConfig.getUserProperties().put(
WsWebSocketContainer.SSL_TRUSTSTORE_PROPERTY,
truststoreFile.getAbsolutePath());
Session wsSession = wsContainer.connectToServer(
TesterProgrammaticEndpoint.class,
clientEndpointConfig,