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

TLS self signed certificate python Error #14

Open
Balaji-schnell opened this issue Jan 6, 2022 · 1 comment
Open

TLS self signed certificate python Error #14

Balaji-schnell opened this issue Jan 6, 2022 · 1 comment

Comments

@Balaji-schnell
Copy link

i have used these commands to generate server.pem ( self signed certificate ) and server_key.pem (privarte key)
openssl ecparam -out server_key.pem -name secp256r1 -genkey
openssl req -new -key server_key.pem -x509 -nodes -days 365 -out server.pem

and the server running fine
In client side used below cmds to get client certificate and private key

openssl ecparam -out key.pem -name secp256r1 -genkey
openssl req -new -key key.pem -x509 -nodes -days 365 -out cert.pem

In python

client.tls_set(ca_certs="server.pem", certfile="cert.pem ", keyfile="key.pem", \ cert_reqs=ssl.CERT_NONE,tls_version=ssl.PROTOCOL_TLSv1_2, ciphers=None);

client.tls_insecure_set(False)
client.connect("XXXXXXXX", 8883, 60)

Error:

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] self signed certificate (_ssl.c:1131)

Configuration

In thingsboard.conf

export MQTT_SSL_ENABLED=true
export MQTT_SSL_BIND_ADDRESS=0.0.0.0
export MQTT_SSL_BIND_PORT=8883
export MQTT_SSL_CREDENTIALS_TYPE=PEM
export MQTT_SSL_PEM_CERT=/etc/thingsboard/conf/server.pem
export MQTT_SSL_PEM_KEY=/etc/thingsboard/conf/server_key.pem
export MQTT_SSL_PEM_KEY_PASSWORD=password **

Versions (please complete the following information):

  • OS: [e.g. Ubuntu 18.04]
  • ThingsBoard v.3.3.2PE
  • Python 3.8.10
@samson0v
Copy link
Contributor

Hi @Balaji-schnell, is this issue still actual for you?

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