Skip to content

Commit 7674fd2

Browse files
author
Matthew Sackman
committed
merge in from bug 19356
2 parents c0a46b9 + 8f2b9cd commit 7674fd2

19 files changed

+694
-123
lines changed

.hgignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ syntax: regexp
44
^local\.build$
55
^TestResult.xml$
66
^releases$
7+
^commit$
8+
^diff$
79

810
^src/wcf/.*/(bin|obj)$
911
^src/wcf/.*/*.suo$
1012

1113
^src/wcf/RabbitMQ\.ServiceModel/RabbitMQ\.ServiceModel\.xml
1214
^src/wcf/RabbitMQ\.ServiceModel/AssemblyInfo\.cs$
15+
1316
^wix/dotnet-client-merge-module\.wxs$
1417
^wix/dotnet-client-product\.wxs$
1518
^wix/License\.rtf$

configs/dotnet-1.1.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
<property name="target.framework" value="net-1.1" />
44
<property name="debug" value="true"/>
55
<property name="python.exec" value="python.exe"/>
6+
<property name="certmgr.exec" value="certmgr.exe"/>
67
</project>

configs/dotnet-2.0.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
<property name="target.framework" value="net-2.0" />
44
<property name="debug" value="true"/>
55
<property name="python.exec" value="python.exe"/>
6+
<property name="certmgr.exec" value="certmgr.exe"/>
67
</project>

configs/mono-1.0.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
<property name="debug" value="true"/>
55
<property name="msbuild" value="xbuild"/>
66
<property name="python.exec" value="python"/>
7+
<property name="certmgr.exec" value="certmgr"/>
78
</project>

configs/mono-2.0.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
<property name="debug" value="true"/>
55
<property name="msbuild" value="xbuild"/>
66
<property name="python.exec" value="python"/>
7+
<property name="certmgr.exec" value="certmgr"/>
78
</project>

default.build

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,25 @@
307307
<copy file="${nunit.dllname}" todir="${bin.dir}"/>
308308
</target>
309309

310+
<target name="detect-ssl">
311+
<property name="ssl.avail" value="false"/>
312+
<property name="ssl.avail" value="true"
313+
if="${environment::variable-exists('SSL_CERTS_DIR')}"/>
314+
<property name="ssl.certs.dir" value="${environment::get-variable('SSL_CERTS_DIR')}"
315+
if="${environment::variable-exists('SSL_CERTS_DIR')}"/>
316+
</target>
317+
318+
<target name="import-ssl" description="import cacert into certmgr" depends="detect-ssl" if="${ssl.avail}">
319+
<exec program="${certmgr.exec}">
320+
<arg value="-add"/>
321+
<arg value="-c"/>
322+
<arg value="Trust"/>
323+
<arg value="${ssl.certs.dir}/testca/cacert.cer"/>
324+
</exec>
325+
</target>
326+
310327
<target name="unit" description="run unit tests"
311-
depends="build-unit">
328+
depends="build-unit,import-ssl">
312329
<exec program="src/unit/nunit/nunit-console.exe" useruntimeengine="true">
313330
<arg value="${unit-tests.dllname}"/>
314331
</exec>

src/client/api/AmqpTcpEndpoint.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,35 @@ public int Port
9191
set { m_port = value; }
9292
}
9393

94+
95+
private SslOption m_ssl;
96+
///<summary>Retrieve the SSL options for this AmqpTcpEndpoint.
97+
///If not set, null is returned</summary>
98+
public SslOption Ssl
99+
{
100+
get { return m_ssl; }
101+
set { m_ssl = value; }
102+
}
103+
94104
///<summary>Construct an AmqpTcpEndpoint with the given
95105
///IProtocol, hostname, and port number. If the port number is
96106
///-1, the default port number for the IProtocol will be
97107
///used.</summary>
98-
public AmqpTcpEndpoint(IProtocol protocolVariant, string hostname, int portOrMinusOne)
108+
public AmqpTcpEndpoint(IProtocol protocolVariant, string hostname, int portOrMinusOne):
109+
this(protocolVariant, hostname, portOrMinusOne, new SslOption())
110+
{
111+
}
112+
113+
///<summary>Construct an AmqpTcpEndpoint with the given
114+
///IProtocol, hostname, port number and Ssl option. If the port
115+
///number is -1, the default port number for the IProtocol
116+
///will be used.</summary>
117+
public AmqpTcpEndpoint(IProtocol protocolVariant, string hostname, int portOrMinusOne, SslOption ssl)
99118
{
100119
m_protocol = protocolVariant;
101120
m_hostName = hostname;
102121
m_port = portOrMinusOne;
122+
m_ssl = ssl;
103123
}
104124

105125
///<summary>Returns a URI-like string of the form

src/client/api/ConnectionFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ public IConnection CreateConnection(IProtocol version,
260260
int portNumber)
261261
{
262262
return CreateConnection(new AmqpTcpEndpoint[] {
263-
new AmqpTcpEndpoint(version, hostName, portNumber)
263+
new AmqpTcpEndpoint(version, hostName, portNumber, m_parameters.Ssl)
264264
});
265265
}
266266

src/client/api/ConnectionParameters.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public class ConnectionParameters : ICloneable
8989
private ushort m_requestedChannelMax = DefaultChannelMax;
9090
private uint m_requestedFrameMax = DefaultFrameMax;
9191
private ushort m_requestedHeartbeat = DefaultHeartbeat;
92+
private SslOption m_ssl = new SslOption();
9293

9394
///<summary>Construct a fresh instance, with all fields set to
9495
///their respective defaults.</summary>
@@ -136,6 +137,13 @@ public ushort RequestedHeartbeat
136137
set { m_requestedHeartbeat = value; }
137138
}
138139

140+
///<summary>Ssl options setting</summary>
141+
public SslOption Ssl
142+
{
143+
get { return m_ssl; }
144+
set { m_ssl = value; }
145+
}
146+
139147
///<summary>Implement ICloneable.Clone by delegating to our type-safe variant.</summary>
140148
object ICloneable.Clone()
141149
{

src/client/api/QueueingBasicConsumer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ namespace RabbitMQ.Client
7676
/// When the consumer is closed, through BasicCancel or through
7777
/// the shutdown of the underlying IModel or IConnection, the
7878
/// SharedQueue's Close() method is called, which causes any
79-
/// threads blocked on the queue's Enqueue() or Dequeue()
80-
/// operations to throw EndOfStreamException (see the comment for
79+
/// Enqueue() operations, and Dequeue() operations when the queue
80+
/// is empty, to throw EndOfStreamException (see the comment for
8181
/// SharedQueue.Close()).
8282
///</para>
8383
///<para>

0 commit comments

Comments
 (0)