I need to create a server written in vb6 for secure websocket (https), I can create only for http websocket.
But I don't know about the secure encryption protocol that the "wss" version has, so I'm interested in how to implement it.
i had to interact with a secure websocket for one project I ended up doing it in GO because the code was
readily available. I looked into maybe creating a GO dll and making this available to VB6 but it did not seem like
go has great interoperability. I also found a huge c++ library that supported it but it wasnt worth messing with.
im not 100% but I think the websocket standard is more than just a https enabled connection?
1. Search for "vb6 for secure websocket https" in google
2. In top 5 results there is this github project: VbAsyncSocket
cheers,
</wqw>
Very interesting and useful code to write in https. but I couldn't adapt it to work on https websocket secure (wss) there is a connection request, but it doesn't trigger data arrival event in TLS protocol and it only reaches encrypted TCP.
Could you try adapting it with a practical example ?, since it seems that you understand the subject better. I'm desperate haha, thank you!
Last edited by Maatooh; Oct 13th, 2020 at 04:14 PM.
I found this list of websocket libraries, none in VB6 yet. There are some command line
ones which might be of help without having to program in another language.
I extracted the encrypted characters that I receive from the wss client and transformed them to hexadecimal, they are as follows.
This is a TLS handshake, the ClientHello message. First byte 0x16 means TLS_CONTENT_TYPE_HANDSHAKE, second and third bytes 0x0301 mean the protocol version which is TLS 1.0, etc. So you need a TLS enabled socket class to "speak" encryption with your clients. Which one do you currently use?
Did you check the sample projects in the VbAsyncSocket repo linked above? There is Project1.vbp in test/secure (and Project2.vbp which is an SSPI/Schannel based alternative) which starts an https server with self-signed certificate or custom PEM encoded one, and accepts client requests on port 10443 which are then dispatched to cRequestHandler class. It uses calls to ReceiveArray method of cTlsSocket class to read already decrypted traffic (not like the hexdump above).
Anyway, the discussion is not going to be very useful unless you post exactly the code that is failing. Hexdumps are not enough. Prepare a sample project/snippet with the WSS/TLS server which is not working as expected.
As wqweto has stated, the Hex dump you provided is a Client Hello, and is not encrypted. Encryption occurs only after the Client and Server Hellos. Below is a breakdown of the information provided. There is some information that I was unable to decipher, particularly the 8A 8A, DA DA, EA EA, etc. All the zeros are optional padding.
Thank you very much for your answers, it has helped me understand a lot. Even so, I have not managed to make the wss server in this time, since the project is very extensive. I would like to ask you if you dare to write the project together, I am really beginning to understand tls and I have high hopes of achieving it.
Can you tell me where you would like to start from to access the files.
Thank you very much for your answers, it has helped me understand a lot. Even so, I have not managed to make the wss server in this time, since the project is very extensive. I would like to ask you if you dare to write the project together, I am really beginning to understand tls and I have high hopes of achieving it.
Can you tell me where you would like to start from to access the files.
Thank you!
I am currently in the process of trying to create a simple secure Web Server, but it is proving to be anything but simple. I will post it in the CodeBank once I get the bugs worked out. I have chosen to use TLS 1.3, because it is my belief that ECC (Elliptical Curve Cryptography) is the way of the future. Most Web Servers now support both TLS 1.2 and TLS 1.3, but supporting both really complicates the process. Only a small part of TLS 1.2 supports ECC, and previous secure protocols (SSL, TLS 1.0, & TLS 1.1) are now deprecated.