Commit 8b5f49d1 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Look for Root CA certificates in VLC data dir

parent 12c4a861
...@@ -529,6 +529,9 @@ gnutls_Addx509File( vlc_object_t *p_this, ...@@ -529,6 +529,9 @@ gnutls_Addx509File( vlc_object_t *p_this,
return gnutls_Addx509Directory( p_this, cred, psz_path, b_priv); return gnutls_Addx509Directory( p_this, cred, psz_path, b_priv);
} }
} }
else
msg_Warn( p_this, "Cannot add x509 credentials (%s): %s",
psz_path, strerror( errno ) );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -586,20 +589,20 @@ gnutls_ClientCreate( tls_t *p_tls ) ...@@ -586,20 +589,20 @@ gnutls_ClientCreate( tls_t *p_tls )
char *psz_path; char *psz_path;
if( asprintf( &psz_path, "%s/"CONFIG_DIR"/ssl/certs", if( asprintf( &psz_path, "%s/"CONFIG_DIR"/ssl/certs",
p_tls->p_vlc->psz_homedir ) == -1 ) p_tls->p_vlc->psz_homedir ) != -1 )
{ {
gnutls_certificate_free_credentials( p_sys->x509_cred ); gnutls_Addx509Directory( (vlc_object_t *)p_session,
goto error; p_sys->x509_cred, psz_path, VLC_FALSE );
free( psz_path );
} }
gnutls_Addx509Directory( (vlc_object_t *)p_session, p_sys->x509_cred, if( asprintf( &psz_path, "%s/ca-certificates.crt",
psz_path, VLC_FALSE ); config_GetDataDir ( (vlc_object_t *)p_session) ) != -1 )
#ifdef X509_CA_BUNDLE {
gnutls_Addx509File( (vlc_object_t *)p_session, p_sys->x509_cred, gnutls_Addx509File( (vlc_object_t *)p_session,
X509_CA_BUNDLE, VLC_FALSE ); p_sys->x509_cred, psz_path, VLC_FALSE );
#endif
free( psz_path ); free( psz_path );
}
p_session->pf_handshake2 = gnutls_HandshakeAndValidate; p_session->pf_handshake2 = gnutls_HandshakeAndValidate;
} }
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment