Accept server certificate for secured websocket connection - ssl

I am developing a secured Websocket server and realized that SSL at least requires server authentication.. That means, clients need to trust my certificates.
Is there a way to show up an "accept certificate" dialog at time the WSS is being established ?
What is the solution then ? Should I put the web application in an HTTPS connection ?
Of course I want to avoid having to manually send certificate to clients and asking them to trust it.
Thanks.

Websockets are not normal sockets. They are established by upgrading an existing HTTP(s) connection, so if you have HTTP they will be unencrypted and with HTTPS they will be encrypted and all the certificate check is already done before the upgrade to WebSockets started.

Related

Intercept requests in SSL WebSocket connection (wss)

I have a WSS server running, and I want to intercept WebSocket messages between the client and the server.
I am able to intercept WebSocket messages using WS (no SSL) but haven't had any success with WSS (with SSL). I am getting an error about self-signed certs, which my testing client (wscat) doesn't want to use. (self signed certificate in certificate chain)
And lastly, how would I be able to intercept a connection from a different desktop application? So say if application A is trying to connect to a WSS server, how would I intercept that without telling the desktop application to use a proxy?
Thank you!
Unrelated to the question above, but I am also not able to proxy HTTPS requests because of this error:
sslv3 alert bad certificate
I am getting an error about self-signed certs, which my testing client (wscat) doesn't want to use.
This question is really is about wscat and not mitmproxy. https://stackoverflow.com/a/58149466/934719 mentions that you can pass -n to wscat to disable certificate checks for local testing.
And lastly, how would I be able to intercept a connection from a different desktop application? So say if application A is trying to connect to a WSS server, how would I intercept that without telling the desktop application to use a proxy?
If you cannot tell the desktop application to use a proxy, then it's probably the easiest to set up as a reverse proxy.

Is it possible to call Https without encryption?

From my understanding, each browser implement tls/ssl themself, which mean when user open a https website from a browser, the browser is responsible for encrypt the request.
So is it possible to make a browser or any other type of client that doesn't implement tls/ssl and therefore will make https without encryption? And if yes, then how ?
... client that doesn't implement tls/ssl and therefore will make https without encryption?
HTTPS is HTTP inside a TLS connection. This means a client which does not implement SSL/TLS will not be able to make a HTTPS connection in the first place by the very definition of what HTTPS is.
It might in theory be possible though that TLS is used without encryption, i.e. only with authentication and integrity check. Up to TLS version 1.2 there were the NULL ciphers which made this possible. In practice no sane server will implement this. If the client still tries to use such cipher the TLS handshake will fail since there is no common cipher between client and server.
See also Unencrypted SSL protocol?.

Websocket server with Self-Signed certificates in intranet application

I have an intranet application that runs over https and it needs to access a websocket sever that needs to runs over wss because chrome mixed content security. Both applications use self-signed certificates but is not possible to access the websocket server because chrome doesn't trust in self-signed certificate unless user authorize. So, cause of that the connection fails. Is there a way to have a valid certificate to use in intranet application? Or is there another way to solve this problem?
You can generate a certificate for websocket.intranet.example.com with a public DNS that doesn't point to the real websocket server, and then copy that certificate in the real server.
Of course, your internal DNS resolver must point websocket.intranet.example.com to the real websocket server

Does the browser send its own certificate to the Web server during https communication?

I am completely new to the concepts of SSL/https.
My question is, does the browser send its own certificate to the web server during https communication? If yes then where on the client’s computer the certificate is stored?
A browser can send a certificate if the server requests it and it has one. Where those client certs are stored depends on the browser and operating system.

Is data is encrypted (128 bit encryption) in SSL layer?

I configured SSL mechanism in tomcat 6 by generated certificate using java keytool with RSA algorithm and I’m able access the urls using the HTTPS.
Now I have few doubts
While communicating client with server (browser to server or server to browser), is Data also encrypted using 128 bit encryption?
If stand alone application is communicating with server do I get encrypted data only?
Please clarify my doubts. Thanks in advance
Yes, once the SSL connection has been negotiated (which is the first thing that happens), all data (client and server) is encrypted.
Any application communicating over an SSL-secured channel will have all its data encrypted and (because of certificate signing) it will be relatively confident that it's speaking with the actor it thinks it should be speaking with (ie, it will have protection against MITM attacks).
If you're connecting with an SSL-enabled client (whether that's a browser, libcurl, or something else) to whatever port you have configured for SSL, your entire communication path will be encrypted. If you try to connect with a non-SSL-enabled client to an HTTPS listener, you'll get a Bad Request error message like this:
Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.
If you're really concerned, try using something like Wireshark to view the communication between client and server.