Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for wss via sslEngineConfigurator #4

Open
sreeraaman opened this issue Jul 14, 2016 · 1 comment
Open

Add support for wss via sslEngineConfigurator #4

sreeraaman opened this issue Jul 14, 2016 · 1 comment

Comments

@sreeraaman
Copy link

The RemoteP2P module currently instantiates the websocket client via the following:

ClientManager client = ClientManager.createClient();

However, if a custom ssl context has to be created, we need to add a client property as follows:

client.getProperties().put("org.glassfish.tyrus.client.sslEngineConfigurator",
sslEngineConfigurator);

The sslengineconfigurator is configured as follows. This is typically done by the application Instantiating the RemoteP2PModule.

System.getProperties().put(SSLContextConfigurator.TRUST_STORE_FILE, trustStoreLocation);
System.getProperties().put(SSLContextConfigurator.TRUST_STORE_PASSWORD, "xxx");
final SSLContextConfigurator defaultConfig = new SSLContextConfigurator();

    defaultConfig.retrieve(System.getProperties());
    SSLEngineConfigurator sslEngineConfigurator = new SSLEngineConfigurator(defaultConfig, true, false,
            false);

Add a new constructor to the RemoteP2PModule as follows:

public RemoteP2PModule(URI baseURI,SSLEngineConfigurator configurator) {
this.baseServerUri = baseURI;
this.sslEngineConfigurator = configurator;
}

Add an instance variable as below:

SSLEngineConfigurator sslEngineConfigurator;
@krusche
Copy link
Member

krusche commented Jul 14, 2016

Can you provide a pull request with these changes?
I think both should be possible, ws and wss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants