mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
sip_to_pjsip: Add cert_file and ca_list_path.
When using the migration script sip_to_pjsip.py, cert_file and ca_list_path were not migrated to pjsip.conf. ASTERISK-22374 Change-Id: I4612877d190b7f86a48698cefbf5c4db6c265825
This commit is contained in:
@@ -464,6 +464,7 @@ peer_map = [
|
|||||||
# bind
|
# bind
|
||||||
# async_operations
|
# async_operations
|
||||||
# ca_list_file
|
# ca_list_file
|
||||||
|
# ca_list_path
|
||||||
# cert_file
|
# cert_file
|
||||||
# privkey_file
|
# privkey_file
|
||||||
# password
|
# password
|
||||||
@@ -697,6 +698,12 @@ def set_tls_bindaddr(val, pjsip, nmapped):
|
|||||||
set_value('bind', bind, 'transport-tls', pjsip, nmapped, 'transport')
|
set_value('bind', bind, 'transport-tls', pjsip, nmapped, 'transport')
|
||||||
|
|
||||||
|
|
||||||
|
def set_tls_cert_file(val, pjsip, section, nmapped):
|
||||||
|
"""Sets cert_file based on sip.conf tlscertfile"""
|
||||||
|
set_value('cert_file', val, section, pjsip, nmapped,
|
||||||
|
'transport')
|
||||||
|
|
||||||
|
|
||||||
def set_tls_private_key(val, pjsip, nmapped):
|
def set_tls_private_key(val, pjsip, nmapped):
|
||||||
"""Sets privkey_file based on sip.conf tlsprivatekey or sslprivatekey"""
|
"""Sets privkey_file based on sip.conf tlsprivatekey or sslprivatekey"""
|
||||||
set_value('priv_key_file', val, 'transport-tls', pjsip, nmapped,
|
set_value('priv_key_file', val, 'transport-tls', pjsip, nmapped,
|
||||||
@@ -714,6 +721,12 @@ def set_tls_cafile(val, pjsip, nmapped):
|
|||||||
'transport')
|
'transport')
|
||||||
|
|
||||||
|
|
||||||
|
def set_tls_capath(val, pjsip, nmapped):
|
||||||
|
"""Sets ca_list_path based on sip.conf tlscapath"""
|
||||||
|
set_value('ca_list_path', val, 'transport-tls', pjsip, nmapped,
|
||||||
|
'transport')
|
||||||
|
|
||||||
|
|
||||||
def set_tls_verifyclient(val, pjsip, nmapped):
|
def set_tls_verifyclient(val, pjsip, nmapped):
|
||||||
"""Sets verify_client based on sip.conf tlsverifyclient"""
|
"""Sets verify_client based on sip.conf tlsverifyclient"""
|
||||||
set_value('verify_client', val, 'transport-tls', pjsip, nmapped,
|
set_value('verify_client', val, 'transport-tls', pjsip, nmapped,
|
||||||
@@ -755,9 +768,11 @@ def create_tls(sip, pjsip, nmapped):
|
|||||||
|
|
||||||
tls_map = [
|
tls_map = [
|
||||||
(['tlsbindaddr', 'sslbindaddr'], set_tls_bindaddr),
|
(['tlsbindaddr', 'sslbindaddr'], set_tls_bindaddr),
|
||||||
|
(['tlscertfile', 'sslcert', 'tlscert'], set_tls_cert_file),
|
||||||
(['tlsprivatekey', 'sslprivatekey'], set_tls_private_key),
|
(['tlsprivatekey', 'sslprivatekey'], set_tls_private_key),
|
||||||
(['tlscipher', 'sslcipher'], set_tls_cipher),
|
(['tlscipher', 'sslcipher'], set_tls_cipher),
|
||||||
(['tlscafile'], set_tls_cafile),
|
(['tlscafile'], set_tls_cafile),
|
||||||
|
(['tlscapath', 'tlscadir'], set_tls_capath),
|
||||||
(['tlsverifyclient'], set_tls_verifyclient),
|
(['tlsverifyclient'], set_tls_verifyclient),
|
||||||
(['tlsdontverifyserver'], set_tls_verifyserver),
|
(['tlsdontverifyserver'], set_tls_verifyserver),
|
||||||
(['tlsclientmethod', 'sslclientmethod'], set_tls_method)
|
(['tlsclientmethod', 'sslclientmethod'], set_tls_method)
|
||||||
|
Reference in New Issue
Block a user