summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2009-07-01 13:43:08 +0000
committerRafael H. Schloming <rhs@apache.org>2009-07-01 13:43:08 +0000
commitcc0cb6411e14e23d45304c3ae84069d59b29465a (patch)
tree1c09afa39814b8d2261c9eb11282eb60e637ea16
parenta20676e68b1b27a5a40bba56311f82db32e6d07b (diff)
downloadqpid-python-cc0cb6411e14e23d45304c3ae84069d59b29465a.tar.gz
fixed hang in SSL client, ssl profile still fails due to port conflicts, but it should no longer hang
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@790161 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/common/src/main/java/org/apache/qpid/transport/network/ssl/SSLReceiver.java5
-rw-r--r--java/common/src/main/java/org/apache/qpid/transport/network/ssl/SSLSender.java33
-rw-r--r--java/cpp.ssl.testprofile2
3 files changed, 25 insertions, 15 deletions
diff --git a/java/common/src/main/java/org/apache/qpid/transport/network/ssl/SSLReceiver.java b/java/common/src/main/java/org/apache/qpid/transport/network/ssl/SSLReceiver.java
index 011c38c2d7..e6e6c5f791 100644
--- a/java/common/src/main/java/org/apache/qpid/transport/network/ssl/SSLReceiver.java
+++ b/java/common/src/main/java/org/apache/qpid/transport/network/ssl/SSLReceiver.java
@@ -95,6 +95,11 @@ public class SSLReceiver implements Receiver<ByteBuffer>
try
{
SSLEngineResult result = engine.unwrap(netData, appData);
+ synchronized (notificationToken)
+ {
+ notificationToken.notifyAll();
+ }
+
int read = result.bytesProduced();
status = result.getStatus();
handshakeStatus = result.getHandshakeStatus();
diff --git a/java/common/src/main/java/org/apache/qpid/transport/network/ssl/SSLSender.java b/java/common/src/main/java/org/apache/qpid/transport/network/ssl/SSLSender.java
index e8d50d9020..0e785bb2ee 100644
--- a/java/common/src/main/java/org/apache/qpid/transport/network/ssl/SSLSender.java
+++ b/java/common/src/main/java/org/apache/qpid/transport/network/ssl/SSLSender.java
@@ -200,21 +200,26 @@ public class SSLSender implements Sender<ByteBuffer>
flush();
synchronized(engineState)
{
- long start = System.currentTimeMillis();
- try
+ switch (engine.getHandshakeStatus())
{
- engineState.wait(timeout);
- }
- catch(InterruptedException e)
- {
- // pass
- }
-
- if (System.currentTimeMillis()- start >= timeout)
- {
- throw new SenderException(
- "SSL Engine timed out waiting for a response." +
- "To get more info,run with -Djavax.net.debug=ssl");
+ case NEED_UNWRAP:
+ long start = System.currentTimeMillis();
+ try
+ {
+ engineState.wait(timeout);
+ }
+ catch(InterruptedException e)
+ {
+ // pass
+ }
+
+ if (System.currentTimeMillis()- start >= timeout)
+ {
+ throw new SenderException(
+ "SSL Engine timed out waiting for a response." +
+ "To get more info,run with -Djavax.net.debug=ssl");
+ }
+ break;
}
}
break;
diff --git a/java/cpp.ssl.testprofile b/java/cpp.ssl.testprofile
index 74316e7da0..6812ebfae4 100644
--- a/java/cpp.ssl.testprofile
+++ b/java/cpp.ssl.testprofile
@@ -1,5 +1,5 @@
broker.version=0-10
-broker=${project.root}/../cpp/src/qpidd -p @PORT --load-module ${project.root}/../cpp/src/.libs/ssl.so --ssl-cert-password-file ${project.root}/test_resources/ssl/pfile --ssl-cert-db ${project.root}/test_resources/ssl/server_db/ --ssl-require-client-authentication --data-dir ${build.data}/@PORT -t --auth no
+broker=${project.root}/../cpp/src/qpidd -p @PORT --load-module ${project.root}/../cpp/src/.libs/ssl.so --ssl-cert-name localhost.localdomain --ssl-cert-password-file ${project.root}/test_resources/ssl/pfile --ssl-cert-db ${project.root}/test_resources/ssl/server_db/ --ssl-require-client-authentication --data-dir ${build.data}/@PORT -t --auth no
test.excludesfile=${project.root}/ExcludeList ${project.root}/010ExcludeList ${project.root}/010ExcludeList-ssl
test.excludeslist=org.apache.qpid.test.client.failover.FailoverTest#*
profile.use_ssl=true