-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…nt SSL tests
- Loading branch information
Showing
2 changed files
with
57 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,7 +56,7 @@ public SslFilter(String targetHost, X509CertificateCollection clientCertificates | |
TargetHost = targetHost; | ||
ClientCertificates = clientCertificates; | ||
UseClientMode = true; | ||
CheckCertificateRevocation = true; | ||
CheckCertificateRevocation = false; | ||
} | ||
|
||
/// <summary> | ||
|
@@ -86,7 +86,8 @@ public X509Certificate Certificate | |
/// <summary> | ||
/// Gets or sets a <see cref="Boolean"/> value that specifies | ||
/// whether the certificate revocation list is checked during authentication. | ||
/// The default value is <code>true</code>. | ||
/// The default value is <code>true</code> in server mode, | ||
/// <code>false</code> in client mode. | ||
/// </summary> | ||
public Boolean CheckCertificateRevocation { get; set; } | ||
|
||
|
@@ -446,6 +447,9 @@ public void ScheduleFilterWrite(INextFilter nextFilter, IWriteRequest writeReque | |
} | ||
|
||
IoBuffer buf = (IoBuffer)writeRequest.Message; | ||
if (!buf.HasRemaining) | ||
This comment has been minimized.
Sorry, something went wrong. |
||
// empty message will break this SSL stream? | ||
return; | ||
lock (this) | ||
{ | ||
ArraySegment<Byte> array = buf.GetRemaining(); | ||
|
@@ -507,7 +511,7 @@ private IoBuffer ReadBuffer() | |
while (true) | ||
{ | ||
ArraySegment<Byte> array = buf.GetRemaining(); | ||
Int32 bytesRead = _sslStream.Read(array.Array, array.Offset, buf.Capacity); | ||
Int32 bytesRead = _sslStream.Read(array.Array, array.Offset, array.Count); | ||
This comment has been minimized.
Sorry, something went wrong.
longshine
Author
Owner
|
||
if (bytesRead <= 0) | ||
break; | ||
buf.Position += bytesRead; | ||
|
@@ -517,7 +521,7 @@ private IoBuffer ReadBuffer() | |
else | ||
{ | ||
// We have to grow the target buffer, it's too small. | ||
buf.Capacity <<= buf.Capacity; | ||
This comment has been minimized.
Sorry, something went wrong. |
||
buf.Capacity <<= 1; | ||
buf.Limit = buf.Capacity; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Client sending an empty buffer into the
SslStream
will make the stream in the server hang up:the following call to
_sslStream.Read
inSslHandler.ReadBufer
will never return.Don't know why : (