Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
pulsar
提交
e7622f3a
pulsar
项目概览
apache
/
pulsar
通知
129
Star
40
Fork
3
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
pulsar
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
体验新版 GitCode,发现更多精彩内容 >>
提交
e7622f3a
编写于
4月 18, 2017
作者:
Y
Yuki Shiga
提交者:
Andrews
4月 17, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed WebSocket TLS connection bug (#356)
上级
92786239
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
0 deletion
+25
-0
pulsar-websocket/src/main/java/com/yahoo/pulsar/websocket/WebSocketService.java
...ain/java/com/yahoo/pulsar/websocket/WebSocketService.java
+5
-0
pulsar-websocket/src/main/java/com/yahoo/pulsar/websocket/service/WebSocketProxyConfiguration.java
...pulsar/websocket/service/WebSocketProxyConfiguration.java
+20
-0
未找到文件。
pulsar-websocket/src/main/java/com/yahoo/pulsar/websocket/WebSocketService.java
浏览文件 @
e7622f3a
...
...
@@ -160,6 +160,9 @@ public class WebSocketService implements Closeable {
private
PulsarClient
createClientInstance
(
ClusterData
clusterData
)
throws
IOException
{
ClientConfiguration
clientConf
=
new
ClientConfiguration
();
clientConf
.
setStatsInterval
(
0
,
TimeUnit
.
SECONDS
);
clientConf
.
setUseTls
(
config
.
isTlsEnabled
());
clientConf
.
setTlsAllowInsecureConnection
(
config
.
isTlsAllowInsecureConnection
());
clientConf
.
setTlsTrustCertsFilePath
(
config
.
getTlsTrustCertsFilePath
());
if
(
config
.
isAuthenticationEnabled
())
{
clientConf
.
setAuthentication
(
config
.
getBrokerClientAuthenticationPlugin
(),
config
.
getBrokerClientAuthenticationParameters
());
...
...
@@ -194,8 +197,10 @@ public class WebSocketService implements Closeable {
serviceConfig
.
setGlobalZookeeperServers
(
config
.
getGlobalZookeeperServers
());
serviceConfig
.
setZooKeeperSessionTimeoutMillis
(
config
.
getZooKeeperSessionTimeoutMillis
());
serviceConfig
.
setTlsEnabled
(
config
.
isTlsEnabled
());
serviceConfig
.
setTlsTrustCertsFilePath
(
config
.
getTlsTrustCertsFilePath
());
serviceConfig
.
setTlsCertificateFilePath
(
config
.
getTlsCertificateFilePath
());
serviceConfig
.
setTlsKeyFilePath
(
config
.
getTlsKeyFilePath
());
serviceConfig
.
setTlsAllowInsecureConnection
(
config
.
isTlsAllowInsecureConnection
());
return
serviceConfig
;
}
...
...
pulsar-websocket/src/main/java/com/yahoo/pulsar/websocket/service/WebSocketProxyConfiguration.java
浏览文件 @
e7622f3a
...
...
@@ -65,6 +65,10 @@ public class WebSocketProxyConfiguration implements PulsarConfiguration {
private
String
tlsCertificateFilePath
;
// Path for the TLS private key file
private
String
tlsKeyFilePath
;
// Path for the trusted TLS certificate file
private
String
tlsTrustCertsFilePath
=
""
;
// Accept untrusted TLS certificate from client
private
boolean
tlsAllowInsecureConnection
=
false
;
private
Properties
properties
=
new
Properties
();
...
...
@@ -203,6 +207,22 @@ public class WebSocketProxyConfiguration implements PulsarConfiguration {
public
void
setTlsKeyFilePath
(
String
tlsKeyFilePath
)
{
this
.
tlsKeyFilePath
=
tlsKeyFilePath
;
}
public
String
getTlsTrustCertsFilePath
()
{
return
tlsTrustCertsFilePath
;
}
public
void
setTlsTrustCertsFilePath
(
String
tlsTrustCertsFilePath
)
{
this
.
tlsTrustCertsFilePath
=
tlsTrustCertsFilePath
;
}
public
boolean
isTlsAllowInsecureConnection
()
{
return
tlsAllowInsecureConnection
;
}
public
void
setTlsAllowInsecureConnection
(
boolean
tlsAllowInsecureConnection
)
{
this
.
tlsAllowInsecureConnection
=
tlsAllowInsecureConnection
;
}
public
Properties
getProperties
()
{
return
properties
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录