]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3071 This is the sofia changes following the addition of the passphrase in libsofia
authorMarc Olivier Chouinard <mochouinard@moctel.com>
Sun, 18 Dec 2011 16:20:38 +0000 (11:20 -0500)
committerMarc Olivier Chouinard <mochouinard@moctel.com>
Sun, 18 Dec 2011 16:20:38 +0000 (11:20 -0500)
conf/sip_profiles/external.xml
conf/sip_profiles/internal.xml
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c

index 27e76a2edb2ef817e27f4ddf7e429241de2a9607..fd7e5818dbec4e9e0fe2d17b51d043ad80a15cb3 100644 (file)
@@ -77,6 +77,8 @@
     <param name="tls-cert-dir" value="$${external_ssl_dir}"/>
     <!-- TLS version ("sslv23" (default), "tlsv1"). NOTE: Phones may not work with TLSv1 -->
     <param name="tls-version" value="$${sip_tls_version}"/>
+    <!-- Optionally set the passphrase password used by openSSL to encrypt/decrypt TLS private key files -->
+    <param name="tls-passphrase" value=""/>
 
   </settings>
 </profile>
index c9855c4bfe00b2c6c6964c9b19b1cc8823dad41d..ea0df5622871fa2db6150aba2a25c5ccbb4b7127 100644 (file)
     <param name="tls-cert-dir" value="$${internal_ssl_dir}"/>
     <!-- TLS version ("sslv23" (default), "tlsv1"). NOTE: Phones may not work with TLSv1 -->
     <param name="tls-version" value="$${sip_tls_version}"/>
+    <!-- Optionally set the passphrase password used by openSSL to encrypt/decrypt TLS private key files -->
+    <param name="tls-passphrase" value=""/>
 
     <!-- turn on auto-flush during bridge (skip timer sleep when the socket already has data) 
         (reduces delay on latent connections default true, must be disabled explicitly)-->
index 13e50cdf513ec72adc114758f5b793e695193d1b..8e96d853f30733612b60efcaa3c3755d0c3feb5c 100644 (file)
@@ -639,6 +639,7 @@ struct sofia_profile {
        switch_mutex_t *gw_mutex;
        uint32_t queued_events;
        uint32_t cseq_base;
+       char *tls_passphrase;
 };
 
 struct private_object {
index c116acad4b0c59315d6b9e8f5c7e9ff5144e382a..11c2db8388d89e999317b6f136cce2605bf48c5c 100644 (file)
@@ -1870,6 +1870,8 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
                                                                         NUTAG_SIPS_URL(profile->tls_bindurl)),
                                                          TAG_IF(sofia_test_pflag(profile, PFLAG_TLS),
                                                                         NUTAG_CERTIFICATE_DIR(profile->tls_cert_dir)),
+                                                         TAG_IF(sofia_test_pflag(profile, PFLAG_TLS) && profile->tls_passphrase,
+                                                                       TPTAG_TLS_PASSPHRASE(profile->tls_passphrase)),
                                                          TAG_IF(sofia_test_pflag(profile, PFLAG_TLS),
                                                                         TPTAG_TLS_VERIFY_POLICY(0)),
                                                          TAG_IF(sofia_test_pflag(profile, PFLAG_TLS),
@@ -4409,6 +4411,8 @@ switch_status_t config_sofia(int reload, char *profile_name)
                                                }
                                        } else if (!strcasecmp(var, "tls-cert-dir")) {
                                                profile->tls_cert_dir = switch_core_strdup(profile->pool, val);
+                                       } else if (!strcasecmp(var, "tls-passphrase")) {
+                                               profile->tls_passphrase = switch_core_strdup(profile->pool, val);
                                        } else if (!strcasecmp(var, "tls-version")) {
 
                                                if (!strcasecmp(val, "tlsv1")) {