Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
c5d256a1
Commit
c5d256a1
authored
Nov 06, 2004
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix to use TLS module dynamically
parent
e4212530
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
modules/control/http.c
modules/control/http.c
+24
-2
No files found.
modules/control/http.c
View file @
c5d256a1
...
...
@@ -190,6 +190,7 @@ struct intf_sys_t
playlist_t
*
p_playlist
;
input_thread_t
*
p_input
;
vlm_t
*
p_vlm
;
tls_t
*
p_tls
;
};
...
...
@@ -236,13 +237,27 @@ static int Open( vlc_object_t *p_this )
if
(
psz_cert
!=
NULL
)
{
const
char
*
psz_pem
;
p_sys
->
p_tls
=
vlc_object_create
(
p_this
,
VLC_OBJECT_TLS
);
vlc_object_attach
(
p_sys
->
p_tls
,
p_this
);
p_sys
->
p_tls
->
p_module
=
module_Need
(
p_sys
->
p_tls
,
"tls"
,
0
,
0
);
if
(
p_sys
->
p_tls
->
p_module
==
NULL
)
{
msg_Err
(
p_this
,
"cannot find TLS/SSL provider"
);
vlc_object_detach
(
p_sys
->
p_tls
);
vlc_object_destroy
(
p_sys
->
p_tls
);
p_sys
->
p_tls
=
NULL
;
return
VLC_EGENERIC
;
}
msg_Dbg
(
p_intf
,
"enablind TLS for HTTP interface (cert file: %s)"
,
psz_cert
);
psz_pem
=
config_GetPsz
(
p_intf
,
"http-intf-key"
);
if
(
psz_pem
==
NULL
)
psz_pem
=
psz_cert
;
p_tls
=
tls_ServerCreate
(
VLC_OBJECT
(
p_intf
)
,
psz_cert
,
psz_pem
);
p_tls
=
tls_ServerCreate
(
p_sys
->
p_tls
,
psz_cert
,
psz_pem
);
if
(
p_tls
==
NULL
)
{
msg_Err
(
p_intf
,
"TLS initialization error"
);
...
...
@@ -273,6 +288,7 @@ static int Open( vlc_object_t *p_this )
}
else
{
p_sys
->
p_tls
=
NULL
;
p_tls
=
NULL
;
if
(
i_port
<=
0
)
i_port
=
8080
;
...
...
@@ -382,7 +398,6 @@ void Close ( vlc_object_t *p_this )
{
vlm_Delete
(
p_sys
->
p_vlm
);
}
for
(
i
=
0
;
i
<
p_sys
->
i_files
;
i
++
)
{
httpd_FileDelete
(
p_sys
->
pp_files
[
i
]
->
p_file
);
...
...
@@ -400,6 +415,13 @@ void Close ( vlc_object_t *p_this )
free
(
p_sys
->
pp_files
);
}
httpd_HostDelete
(
p_sys
->
p_httpd_host
);
/* TODO: do this in the httpd code to avoid code duplication */
if
(
p_sys
->
p_tls
!=
NULL
)
{
module_Unneed
(
p_sys
->
p_tls
,
p_sys
->
p_tls
->
p_module
);
vlc_object_detach
(
p_sys
->
p_tls
);
vlc_object_destroy
(
p_sys
->
p_tls
);
}
free
(
p_sys
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment