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 configuring sslContext in StandardWebSocketClient #30680

Closed
wolf-itc opened this issue Jun 15, 2023 · 3 comments
Closed

Add support for configuring sslContext in StandardWebSocketClient #30680

wolf-itc opened this issue Jun 15, 2023 · 3 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@wolf-itc
Copy link

Currently StandardWebSocketClient supports SSL using user properties:
standardWebSocketClient.setUserProperties(Map.of(Constants.SSL_CONTEXT_PROPERTY, sslContext));

Unfortunately this support ends with Tomcat 11. New way to go:
ClientEndpointConfig endpointConfig = ClientEndpointConfig.Builder.create().sslContext(sslContext).build();

But the creation of ClientEndpointConfig is capsulated in the class StandardWebSocketClient, so sslContext(...) can not be inserted there. Would it be possible to enable that?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jun 15, 2023
@snicoll
Copy link
Member

snicoll commented Oct 8, 2023

That looks reasonable to me. Would moving createEndpointConfig to a protected method do the trick for you?

@snicoll snicoll added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 8, 2023
@snicoll snicoll added this to the 6.2.x milestone Oct 8, 2023
@snicoll snicoll changed the title sslContext for StandardWebSocketClient Add support for configuring sslContext in StandardWebSocketClient Oct 8, 2023
@wolf-itc
Copy link
Author

Hi Stéphane,
thank you for taking the time to look at this!
Yes, I think this should work.
Best regards
Martin

@jhoeller jhoeller added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Dec 28, 2023
@jhoeller jhoeller modified the milestones: 6.2.x, 6.1.3 Dec 28, 2023
@jhoeller jhoeller self-assigned this Dec 28, 2023
@jhoeller
Copy link
Contributor

While for the reactive StandardWebSocketClient, I've turned createEndpointConfig to a protected method indeed (in line with some other protected methods there), I went with direct SSLContext support in the form of a setSslContext method on the regular StandardWebSocketClient (along the lines of the existing user properties support there).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants