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

DVB: remove dead code for TLS and ACL support

parent af7491b0
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_access.h> #include <vlc_access.h>
#include <vlc_httpd.h> #include <vlc_httpd.h>
#include <vlc_acl.h>
#include <sys/types.h> #include <sys/types.h>
...@@ -65,12 +64,9 @@ static int HttpCallback( httpd_file_sys_t *p_args, ...@@ -65,12 +64,9 @@ static int HttpCallback( httpd_file_sys_t *p_args,
int HTTPOpen( access_t *p_access ) int HTTPOpen( access_t *p_access )
{ {
access_sys_t *p_sys = p_access->p_sys; access_sys_t *p_sys = p_access->p_sys;
char *psz_address, *psz_cert = NULL, *psz_key = NULL, char *psz_address, *psz_user = NULL, *psz_password = NULL;
*psz_ca = NULL, *psz_crl = NULL, *psz_user = NULL,
*psz_password = NULL, *psz_acl = NULL;
int i_port = 0; int i_port = 0;
char psz_tmp[10]; char psz_tmp[10];
vlc_acl_t *p_acl = NULL;
httpd_file_sys_t *f; httpd_file_sys_t *f;
vlc_mutex_init( &p_sys->httpd_mutex ); vlc_mutex_init( &p_sys->httpd_mutex );
...@@ -91,24 +87,8 @@ int HTTPOpen( access_t *p_access ) ...@@ -91,24 +87,8 @@ int HTTPOpen( access_t *p_access )
else else
return VLC_SUCCESS; return VLC_SUCCESS;
/* determine SSL configuration */
psz_cert = var_InheritString( p_access, "dvb-http-intf-cert" );
if ( psz_cert != NULL )
{
msg_Dbg( p_access, "enabling TLS for HTTP interface (cert file: %s)",
psz_cert );
psz_key = var_InheritString( p_access, "dvb-http-intf-key" );
psz_ca = var_InheritString( p_access, "dvb-http-intf-ca" );
psz_crl = var_InheritString( p_access, "dvb-http-intf-crl" );
if ( i_port <= 0 )
i_port = 8443;
}
else
{
if ( i_port <= 0 ) if ( i_port <= 0 )
i_port= 8082; i_port= 8082;
}
/* Ugly hack to allow to run several HTTP servers on different ports. */ /* Ugly hack to allow to run several HTTP servers on different ports. */
sprintf( psz_tmp, ":%d", i_port + 1 ); sprintf( psz_tmp, ":%d", i_port + 1 );
...@@ -116,14 +96,8 @@ int HTTPOpen( access_t *p_access ) ...@@ -116,14 +96,8 @@ int HTTPOpen( access_t *p_access )
msg_Dbg( p_access, "base %s:%d", psz_address, i_port ); msg_Dbg( p_access, "base %s:%d", psz_address, i_port );
p_sys->p_httpd_host = httpd_TLSHostNew( VLC_OBJECT(p_access), psz_address, p_sys->p_httpd_host = httpd_HostNew( VLC_OBJECT(p_access), psz_address,
i_port, psz_cert, psz_key, psz_ca, i_port );
psz_crl );
free( psz_cert );
free( psz_key );
free( psz_ca );
free( psz_crl );
if ( p_sys->p_httpd_host == NULL ) if ( p_sys->p_httpd_host == NULL )
{ {
msg_Err( p_access, "cannot listen on %s:%d", psz_address, i_port ); msg_Err( p_access, "cannot listen on %s:%d", psz_address, i_port );
...@@ -134,31 +108,17 @@ int HTTPOpen( access_t *p_access ) ...@@ -134,31 +108,17 @@ int HTTPOpen( access_t *p_access )
psz_user = var_GetNonEmptyString( p_access, "dvb-http-user" ); psz_user = var_GetNonEmptyString( p_access, "dvb-http-user" );
psz_password = var_GetNonEmptyString( p_access, "dvb-http-password" ); psz_password = var_GetNonEmptyString( p_access, "dvb-http-password" );
psz_acl = var_GetNonEmptyString( p_access, "dvb-http-acl" );
if ( psz_acl != NULL )
{
p_acl = ACL_Create( p_access, false );
if( ACL_LoadFile( p_acl, psz_acl ) )
{
ACL_Destroy( p_acl );
p_acl = NULL;
}
}
/* Declare an index.html file. */ /* Declare an index.html file. */
f = malloc( sizeof(httpd_file_sys_t) ); f = malloc( sizeof(httpd_file_sys_t) );
f->p_access = p_access; f->p_access = p_access;
f->p_file = httpd_FileNew( p_sys->p_httpd_host, "/index.html", f->p_file = httpd_FileNew( p_sys->p_httpd_host, "/index.html",
"text/html; charset=UTF-8", "text/html; charset=UTF-8",
psz_user, psz_password, p_acl, psz_user, psz_password, NULL,
HttpCallback, f ); HttpCallback, f );
free( psz_user ); free( psz_user );
free( psz_password ); free( psz_password );
free( psz_acl );
if ( p_acl != NULL )
ACL_Destroy( p_acl );
if ( f->p_file == NULL ) if ( f->p_file == NULL )
{ {
......
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