Thanks for your kind comments. Switching to SSL is straight forward For dev environment you can first create a self signed certificate using the below command. For production, it's recommended to obtain a certificate from a trusted CA. keytool -genkeypair -alias websocket -keyalg RSA -keysize 2048 -storetype PKCS12 -keystore websocket.p12 -validity 3650 Add the below to application.properties server.ssl.key-store=file:/websocket.p12 server.ssl.key-store-password= server.ssl.keyStoreType=PKCS12 server.ssl.keyAlias=websocket server.ssl.enabled=true After that you can access the websocket using url starting with wss://
Since the second one uses STOMP protocol on top of Websocket, I think it might not work since there are no options in postman to enable that. Will try to explore more.
@@Code.Wizzard so it is a case to create simple html page to test your backend app, right? Or maybe is there an ability to write integration tests for this purpose?
Thankyou for this. Best video on spring websocket so far.
Can you please tell me on how to switch to wss from ws using SSL. (I am using spring websocket without stomp & sockjs)
Thanks for your kind comments. Switching to SSL is straight forward
For dev environment you can first create a self signed certificate using the below command. For production, it's recommended to obtain a certificate from a trusted CA.
keytool -genkeypair -alias websocket -keyalg RSA -keysize 2048 -storetype PKCS12 -keystore websocket.p12 -validity 3650
Add the below to application.properties
server.ssl.key-store=file:/websocket.p12
server.ssl.key-store-password=
server.ssl.keyStoreType=PKCS12
server.ssl.keyAlias=websocket
server.ssl.enabled=true
After that you can access the websocket using url starting with wss://
its just a very good video. Thanks
Thanks for your kind feedback
but i have a question: so how we can test 2nd version of your example with postman? Is it absolutly impossible? or is it just hard and inconveniently?
Since the second one uses STOMP protocol on top of Websocket, I think it might not work since there are no options in postman to enable that. Will try to explore more.
@@Code.Wizzard so it is a case to create simple html page to test your backend app, right?
Or maybe is there an ability to write integration tests for this purpose?
@@OleksandrProkopenko_ua correct, either can test it from a UI or write integration test using WebSocketStompClient