Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
f4b0beeb
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f4b0beeb
编写于
11月 09, 2012
作者:
X
xuelei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8001569: Regression test GetPeerHost uses static port number
Reviewed-by: weijun
上级
fe336b37
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
10 deletion
+19
-10
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ServerHandshaker/GetPeerHost.java
...un/net/ssl/internal/ssl/ServerHandshaker/GetPeerHost.java
+8
-5
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ServerHandshaker/GetPeerHostClient.java
.../ssl/internal/ssl/ServerHandshaker/GetPeerHostClient.java
+3
-3
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ServerHandshaker/GetPeerHostServer.java
.../ssl/internal/ssl/ServerHandshaker/GetPeerHostServer.java
+8
-2
未找到文件。
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ServerHandshaker/GetPeerHost.java
浏览文件 @
f4b0beeb
/*
/*
* Copyright (c) 2000, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -21,13 +21,15 @@
...
@@ -21,13 +21,15 @@
* questions.
* questions.
*/
*/
//
// SunJSSE does not support dynamic system properties, no way to re-use
// system properties in samevm/agentvm mode.
//
/**
/**
* @test
* @test
* @bug 4302026
* @bug 4302026
* @run main/othervm GetPeerHost
* @run main/othervm GetPeerHost
*
* SunJSSE does not support dynamic system properties, no way to re-use
* system properties in samevm/agentvm mode.
* @summary make sure the server side doesn't do DNS lookup.
* @summary make sure the server side doesn't do DNS lookup.
*/
*/
import
javax.net.*
;
import
javax.net.*
;
...
@@ -41,7 +43,8 @@ public class GetPeerHost {
...
@@ -41,7 +43,8 @@ public class GetPeerHost {
+
"/../../../../../../../etc/truststore"
);
+
"/../../../../../../../etc/truststore"
);
GetPeerHostServer
server
=
new
GetPeerHostServer
();
GetPeerHostServer
server
=
new
GetPeerHostServer
();
server
.
start
();
server
.
start
();
GetPeerHostClient
client
=
new
GetPeerHostClient
();
GetPeerHostClient
client
=
new
GetPeerHostClient
(
server
.
getServerPort
());
client
.
start
();
client
.
start
();
server
.
join
();
server
.
join
();
if
(!
server
.
getPassStatus
())
{
if
(!
server
.
getPassStatus
())
{
...
...
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ServerHandshaker/GetPeerHostClient.java
浏览文件 @
f4b0beeb
/*
/*
* Copyright (c) 2000, 20
01
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 20
12
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -38,13 +38,13 @@ class GetPeerHostClient extends Thread
...
@@ -38,13 +38,13 @@ class GetPeerHostClient extends Thread
SSLSocket
s
;
SSLSocket
s
;
String
server
;
String
server
;
public
GetPeerHostClient
()
public
GetPeerHostClient
(
int
serverPort
)
{
{
try
{
try
{
SSLSocketFactory
factory
=
(
SSLSocketFactory
)
SSLSocketFactory
SSLSocketFactory
factory
=
(
SSLSocketFactory
)
SSLSocketFactory
.
getDefault
();
.
getDefault
();
server
=
InetAddress
.
getLocalHost
().
getHostName
();
server
=
InetAddress
.
getLocalHost
().
getHostName
();
s
=
(
SSLSocket
)
factory
.
createSocket
(
server
,
9999
);
s
=
(
SSLSocket
)
factory
.
createSocket
(
server
,
serverPort
);
System
.
out
.
println
(
"CLIENT: connected to the server- "
+
server
);
System
.
out
.
println
(
"CLIENT: connected to the server- "
+
server
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
err
.
println
(
"Unexpected exceptions: "
+
e
);
System
.
err
.
println
(
"Unexpected exceptions: "
+
e
);
...
...
test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ServerHandshaker/GetPeerHostServer.java
浏览文件 @
f4b0beeb
/*
/*
* Copyright (c) 2000, 20
01
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 20
12
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -42,6 +42,7 @@ class GetPeerHostServer extends Thread
...
@@ -42,6 +42,7 @@ class GetPeerHostServer extends Thread
private
String
host
;
private
String
host
;
ServerSocket
ss
;
ServerSocket
ss
;
boolean
isHostIPAddr
=
false
;
boolean
isHostIPAddr
=
false
;
int
serverPort
=
0
;
public
GetPeerHostServer
()
public
GetPeerHostServer
()
{
{
...
@@ -57,7 +58,8 @@ class GetPeerHostServer extends Thread
...
@@ -57,7 +58,8 @@ class GetPeerHostServer extends Thread
kmf
.
init
(
ks
,
passphrase
);
kmf
.
init
(
ks
,
passphrase
);
ctx
.
init
(
kmf
.
getKeyManagers
(),
null
,
null
);
ctx
.
init
(
kmf
.
getKeyManagers
(),
null
,
null
);
ServerSocketFactory
ssf
=
ctx
.
getServerSocketFactory
();
ServerSocketFactory
ssf
=
ctx
.
getServerSocketFactory
();
ss
=
ssf
.
createServerSocket
(
9999
);
ss
=
ssf
.
createServerSocket
(
serverPort
);
serverPort
=
ss
.
getLocalPort
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
err
.
println
(
"Unexpected exceptions: "
+
e
);
System
.
err
.
println
(
"Unexpected exceptions: "
+
e
);
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -90,4 +92,8 @@ class GetPeerHostServer extends Thread
...
@@ -90,4 +92,8 @@ class GetPeerHostServer extends Thread
boolean
getPassStatus
()
{
boolean
getPassStatus
()
{
return
isHostIPAddr
;
return
isHostIPAddr
;
}
}
int
getServerPort
()
{
return
serverPort
;
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录