Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
db50702d
提交
db50702d
authored
11月 11, 2016
作者:
Brian West
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-9729 remove hard coded path for cert and key from msrp and add config params for it
上级
e1b3ee1e
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
27 行增加
和
8 行删除
+27
-8
msrp.conf.xml
conf/vanilla/autoload_configs/msrp.conf.xml
+2
-0
switch_msrp.c
src/switch_msrp.c
+25
-8
没有找到文件。
conf/vanilla/autoload_configs/msrp.conf.xml
浏览文件 @
db50702d
...
...
@@ -5,6 +5,8 @@
<param
name=
"listen-ssl-port"
value=
"2856"
/>
<!-- <param name="message-buffer-size" value="50"/> -->
<!-- <param name="debug" value="true"/> -->
<!-- <param name="secure-cert" value="$${certs_dir}/wss.pem"/> -->
<!-- <param name="secure-key" value="$${certs_dir}/wss.pem"/> -->
</settings>
</configuration>
src/switch_msrp.c
浏览文件 @
db50702d
...
...
@@ -40,10 +40,13 @@
static
struct
{
int
running
;
int
debug
;
switch_memory_pool_t
*
pool
;
// switch_mutex_t *mutex;
char
*
ip
;
int
message_buffer_size
;
char
*
cert
;
char
*
key
;
const
SSL_METHOD
*
ssl_method
;
SSL_CTX
*
ssl_ctx
;
SSL
*
ssl
;
...
...
@@ -70,9 +73,6 @@ static void msrp_deinit_ssl()
static
int
msrp_init_ssl
()
{
const
char
*
err
=
""
;
char
*
cert
=
"/usr/local/freeswitch/certs/wss.pem"
;
char
*
key
=
cert
;
SSL_library_init
();
...
...
@@ -103,24 +103,24 @@ static int msrp_init_ssl()
// }
// }
if
(
switch_file_exists
(
cert
,
NULL
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_file_exists
(
globals
.
cert
,
NULL
)
!=
SWITCH_STATUS_SUCCESS
)
{
err
=
"SUPPLIED CERT FILE NOT FOUND
\n
"
;
goto
fail
;
}
if
(
!
SSL_CTX_use_certificate_file
(
globals
.
ssl_ctx
,
cert
,
SSL_FILETYPE_PEM
))
{
if
(
!
SSL_CTX_use_certificate_file
(
globals
.
ssl_ctx
,
globals
.
cert
,
SSL_FILETYPE_PEM
))
{
err
=
"CERT FILE ERROR"
;
goto
fail
;
}
/* set the private key from KeyFile */
if
(
switch_file_exists
(
key
,
NULL
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_file_exists
(
globals
.
key
,
NULL
)
!=
SWITCH_STATUS_SUCCESS
)
{
err
=
"SUPPLIED KEY FILE NOT FOUND
\n
"
;
goto
fail
;
}
if
(
!
SSL_CTX_use_PrivateKey_file
(
globals
.
ssl_ctx
,
key
,
SSL_FILETYPE_PEM
))
{
if
(
!
SSL_CTX_use_PrivateKey_file
(
globals
.
ssl_ctx
,
globals
.
key
,
SSL_FILETYPE_PEM
))
{
err
=
"PRIVATE KEY FILE ERROR"
;
goto
fail
;
}
...
...
@@ -140,7 +140,7 @@ static int msrp_init_ssl()
globals
.
ssl_ready
=
0
;
msrp_deinit_ssl
();
return
0
;
}
...
...
@@ -170,6 +170,10 @@ static switch_status_t load_config()
globals
.
msock_ssl
.
port
=
atoi
(
val
);
}
else
if
(
!
strcasecmp
(
var
,
"debug"
))
{
globals
.
debug
=
switch_true
(
val
);
}
else
if
(
!
strcasecmp
(
var
,
"secure-cert"
))
{
globals
.
cert
=
switch_core_strdup
(
globals
.
pool
,
val
);
}
else
if
(
!
strcasecmp
(
var
,
"secure-key"
))
{
globals
.
key
=
switch_core_strdup
(
globals
.
pool
,
val
);
}
else
if
(
!
strcasecmp
(
var
,
"message-buffer-size"
)
&&
val
)
{
globals
.
message_buffer_size
=
atoi
(
val
);
if
(
globals
.
message_buffer_size
==
0
)
globals
.
message_buffer_size
=
50
;
...
...
@@ -177,6 +181,18 @@ static switch_status_t load_config()
}
}
if
(
!
globals
.
cert
)
{
globals
.
cert
=
switch_core_sprintf
(
globals
.
pool
,
"%s%swss.pem"
,
SWITCH_GLOBAL_dirs
.
certs_dir
,
SWITCH_PATH_SEPARATOR
);
}
if
(
!
globals
.
key
)
{
globals
.
key
=
globals
.
cert
;
}
if
(
switch_file_exists
(
globals
.
key
,
globals
.
pool
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_core_gen_certs
(
globals
.
key
);
}
switch_xml_free
(
xml
);
return
status
;
...
...
@@ -237,6 +253,7 @@ SWITCH_DECLARE(switch_status_t) switch_msrp_init()
memset
(
&
globals
,
0
,
sizeof
(
globals
));
set_global_ip
(
"0.0.0.0"
);
globals
.
pool
=
pool
;
globals
.
msock
.
port
=
(
switch_port_t
)
MSRP_LISTEN_PORT
;
globals
.
msock_ssl
.
port
=
(
switch_port_t
)
MSRP_SSL_LISTEN_PORT
;
globals
.
msock_ssl
.
secure
=
1
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论