Asterisk ssl error with self assigned certificate

Hello, im trying to setup asterisk ssl just for local test and its being a nightmare…
I followed this tutorial: Configuring Asterisk for WebRTC Clients - Asterisk Project - Asterisk Project Wiki

But i dont understand why i keep having this erros:
[Oct 29 17:10:13] ERROR[48723]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error
[Oct 29 17:10:13] ERROR[48723]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer ‘192.168.1.22:49282’
[Oct 29 17:10:13] ERROR[48723]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error
[Oct 29 17:10:13] ERROR[48724]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error
[Oct 29 17:10:13] ERROR[48724]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer ‘192.168.1.22:64554’
[Oct 29 17:10:13] ERROR[48724]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error

I already tried to use this command to check what is wrong
openssl s_client -connect 192.168.1.30:8089
and the error that gives me is:
Can’t use SSL_get_servername
depth=0 CN = 192.168.1.30, O = 192.168.1.30
verify error:num=20:unable to get local issuer certificate

Asterisk current version 18.

Aditional info:
when i try to connect to https://192.168.1.30:8089/ws
opera browser answer me this:
Issuer: Asterisk Private CA

Expires on: 29/10/2022

Current date: 29/10/2021

PEM encoded chain:
-----BEGIN CERTIFICATE-----
MIID1zCCAb8CAQEwDQYJKoZIhvcNAQELBQAwNTEcMBoGA1UEAwwTQXN0ZXJpc2sg
UHJpdmF0ZSBDQTEVMBMGA1UECgwMMTkyLjE2OC4xLjMwMB4XDTIxMTAyOTE1MzIx
N1oXDTIyMTAyOTE1MzIxN1owLjEVMBMGA1UEAwwMMTkyLjE2OC4xLjMwMRUwEwYD
VQQKDAwxOTIuMTY4LjEuMzAwggE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JKoZIhvcNAQELBQADggIBANP6nGVI59YdL7Xg
vIYEW7OCTxV7pDbZk6Ocq0xFlgg2O356BMtPm/7OUVBZyYKJKvpKT4IS0uM0zKJz
/rjjFEWFWEfxWFGG3iwX7wLEsDIZyKava/nSiiCB6UDIDJNWLinTWzVuP2Ui9DjS
D1ntXzt2k8Qf0uOBGuTs2VtL040EvXKUVZ2wHZfp/5mMO0DZr6HYFajMF30LFYVe
H9nsg8s9fzIl1ABu09+/W3Y0qiErwGjRJcgDS2L/+34EppQPgRRz/JItWECurgD5
qVuzYBfLc0SDipDo3EVDnnKyRAa3yVKU1I/o9bz76T8DpakVSdF8GwoCJGHvE/OO
YONt3EtTmALGSSeHT3o8xhK5nqX9mawhaXKbAASJ82q7r0zXMHq14zD+fULaq8pf
olEVj91DaZM+p011PDxOYjIfc0+1ifDOxs777ovQOuTmWjwoK3EN9q/xWSzlC37O
TCKysNxegmOkuaA+UimTWtKLc3ouL0CUjdQiGKjPtP0/EHdhMBGKtRFCpbUockoI
+w4bn4PD3GFkec8/3pyYQ5G4DRYmeRdVlQC1d73z7ZNxYw+drGf/W/zoPFZ+Y7y7
m3GupSfCcgX8/eMD2n/0uDoyairYe7RLE1v//1oQMIEcFTVNytIBOeXTjBoQMe2U
2GQpXqU3q/WranmL1rUcl2DREZMd
-----END CERTIFICATE-----

and this is the log when i start asterisk:
https://docs.google.com/document/d/1FFA3wFg7GqRPyi8toazUAinvSik8fQPL5IL1lOwJO7c/edit?usp=sharing

Sorry for my english and thanks for reading !

More info:
The root certificate that asterisk generate on the tutorial ( ca.crt ) i installed on the computer that is trying to connect to asterisk and still get this erros.

Have you installed it in Asterisk?

No, i didnt installed the certificate on asterisk machine, i installed on the client.
But i think the problem is the browsers that doesnt accept this type of certificate.

I’m referring to the CA certificate. openssl appears to be failing because you haven’t provided it with that.

provided what? i just used the script from asterisk.

Please provide your pjsip.conf settings for the SSL certificate and key files and say what is in each named file.

If not using chan_pjsip, note that chan_sip is deprecated, but provide the same information from sip.conf.

1 Like

its a certificate error. I tried to use the same certificate with golang https and didnt work.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.