+ /* SSL support */
+ if( p_access->psz_access && !strcmp( p_access->psz_access, "https" ) )
+ {
+ const char *psz_cert, *psz_key;
+ psz_cert = config_GetPsz( p_this, SOUT_CFG_PREFIX"cert" );
+ psz_key = config_GetPsz( p_this, SOUT_CFG_PREFIX"key" );
+
+ p_tls = tls_ServerCreate( p_this, psz_cert, psz_key );
+ if ( p_tls == NULL )
+ {
+ msg_Err( p_this, "TLS initialization error" );
+ free( psz_file_name );
+ free( psz_name );
+ free( p_sys );
+ return VLC_EGENERIC;
+ }
+
+ psz_cert = config_GetPsz( p_this, SOUT_CFG_PREFIX"ca" );
+ if ( ( psz_cert != NULL) && tls_ServerAddCA( p_tls, psz_cert ) )
+ {
+ msg_Err( p_this, "TLS CA error" );
+ tls_ServerDelete( p_tls );
+ free( psz_file_name );
+ free( psz_name );
+ free( p_sys );
+ return VLC_EGENERIC;
+ }
+
+ psz_cert = config_GetPsz( p_this, SOUT_CFG_PREFIX"crl" );
+ if ( ( psz_cert != NULL) && tls_ServerAddCRL( p_tls, psz_cert ) )
+ {
+ msg_Err( p_this, "TLS CRL error" );
+ tls_ServerDelete( p_tls );
+ free( psz_file_name );
+ free( psz_name );
+ free( p_sys );
+ return VLC_EGENERIC;
+ }
+
+ if( i_bind_port <= 0 )
+ i_bind_port = DEFAULT_SSL_PORT;
+ }
+ else
+ {
+ p_tls = NULL;
+ if( i_bind_port <= 0 )
+ i_bind_port = DEFAULT_PORT;
+ }
+
+ p_sys->p_httpd_host = httpd_TLSHostNew( VLC_OBJECT(p_access),
+ psz_bind_addr, i_bind_port,
+ p_tls );