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

I want to use wss to use https #1155

Open
jun9090 opened this issue Dec 11, 2024 · 4 comments
Open

I want to use wss to use https #1155

jun9090 opened this issue Dec 11, 2024 · 4 comments

Comments

@jun9090
Copy link

jun9090 commented Dec 11, 2024

I want to use wss to use https
Reference source file : echo_server_tls.cpp
Run error
image
What causes tls handshake failure
Is it possible that the certificate expired? How do I generate the latest certificate?
If the certificate is not expired, what causes the tls handshake to fail?

@Jacob-Burckhardt
Copy link

Run the following command. But first replace hostname.com with the same hostname that your client uses to connect to your server. Also replace the port with the port your client uses.

gnutls-cli hostname.com -p port

The command's output will indicate if the certificate has expired or if there is some other problem with it.

@jun9090
Copy link
Author

jun9090 commented Dec 12, 2024

Thank you for your reply
According to your steps, the use of the pem in the echo_server_tls demo is still an error
image
What causes the error?
Looking forward to your reply

@Jacob-Burckhardt
Copy link

127.0.0.1 is an IP address. Use a hostname instead. Hostnames usually have letters in them and usually end in a top-level domain like com, org, or net.

To determine what hostname to use, run this after replacing server.pem with the filename of your server's pem file.

openssl x509 -in server.pem -text -noout

It might output something like this:

Certificate:
    Data:
        Version: 3 (0x2)
...
        Signature Algorithm: sha256WithRSAEncryption
        Issuer: C = US, O = DigiCert Inc, OU = www.digicert.com, CN = GeoTrust TLS RSA CA G1
        Validity
            Not Before: Feb  5 00:00:00 2024 GMT
            Not After : Feb 25 23:59:59 2025 GMT
        Subject: CN = *.wrtc.teamconnectapp.com

On the last line is the domain name for which the certificate is valid. In the above example that is *.wrtc.teamconnectapp.com. Put a domain name that matches that in your gnutls command line.

Also, notice the above output shows the dates for which the cert is valid. Make sure those dates are correct.

@jun9090
Copy link
Author

jun9090 commented Dec 16, 2024

Thank you for your reply
My issue with tls handshakes has been resolved
The certificate in the demo is really not usable
A signed certificate was used

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