Skip to content

Commit 69cc959

Browse files
author
Matthias Radestock
committed
merge default into bug21531
2 parents ae51054 + a8da523 commit 69cc959

21 files changed

+742
-161
lines changed

.hgignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ 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$
16-
~$
1719

20+
~$

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ ensure-deliverables: rabbit-vsn
4040
file ${RELEASE_DIR}/${NAME_VSN}-net-3.0-wcf-htmldoc
4141

4242
ensure-prerequisites: rabbit-vsn
43-
dpkg -L htmldoc plotutils transfig graphviz > /dev/null
43+
dpkg -L htmldoc plotutils transfig graphviz docbook-utils > /dev/null
4444

4545
ensure-release-dir: rabbit-vsn
4646
touch ${RELEASE_DIR}/

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: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,35 @@ public int Port
9999
set { m_port = value; }
100100
}
101101

102+
103+
private SslOption m_ssl;
104+
///<summary>Retrieve the SSL options for this AmqpTcpEndpoint.
105+
///If not set, null is returned</summary>
106+
public SslOption Ssl
107+
{
108+
get { return m_ssl; }
109+
set { m_ssl = value; }
110+
}
111+
102112
///<summary>Construct an AmqpTcpEndpoint with the given
103-
///IProtocol, hostname, and port number. If the port number is
104-
///-1, the default port number for the IProtocol will be
105-
///used.</summary>
106-
public AmqpTcpEndpoint(IProtocol protocol, string hostName, int portOrMinusOne)
113+
///IProtocol, hostname, port number and ssl option. If the port
114+
///number is -1, the default port number for the IProtocol
115+
///will be used.</summary>
116+
public AmqpTcpEndpoint(IProtocol protocol, string hostName, int portOrMinusOne, SslOption ssl)
107117
{
108118
m_protocol = protocol;
109119
m_hostName = hostName;
110120
m_port = portOrMinusOne;
121+
m_ssl = ssl;
122+
}
123+
124+
///<summary>Construct an AmqpTcpEndpoint with the given
125+
///IProtocol, hostname, and port number. If the port number is
126+
///-1, the default port number for the IProtocol will be
127+
///used.</summary>
128+
public AmqpTcpEndpoint(IProtocol protocol, string hostName, int portOrMinusOne) :
129+
this(protocol, hostName, portOrMinusOne, new SslOption())
130+
{
111131
}
112132

113133
///<summary>Construct an AmqpTcpEndpoint with the given
@@ -154,6 +174,17 @@ public AmqpTcpEndpoint() :
154174
{
155175
}
156176

177+
///<summary>Construct an AmqpTcpEndpoint with the given
178+
///IProtocol, Uri and ssl options.</summary>
179+
///<remarks>
180+
/// Please see the class overview documentation for
181+
/// information about the Uri format in use.
182+
///</remarks>
183+
public AmqpTcpEndpoint(IProtocol protocol, Uri uri, SslOption ssl) :
184+
this(protocol, uri.Host, uri.Port, ssl)
185+
{
186+
}
187+
157188
///<summary>Construct an AmqpTcpEndpoint with the given
158189
///IProtocol and Uri.</summary>
159190
///<remarks>

src/client/api/ConnectionFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ public IConnection CreateConnection(IProtocol version,
261261
{
262262
return CreateConnection(new AmqpTcpEndpoint(version,
263263
hostName,
264-
portNumber));
264+
portNumber,
265+
m_parameters.Ssl));
265266
}
266267

267268
///<summary>Create a connection to the endpoint specified. The

src/client/api/ConnectionParameters.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,16 @@ public class ConnectionParameters : ICloneable
8080
public const uint DefaultFrameMax = 0; // PLEASE KEEP THIS MATCHING THE DOC ABOVE
8181

8282
/// <summary>Default value for desired heartbeat interval, in
83-
/// seconds, with zero meaning none (value: 3)</summary>
84-
public const ushort DefaultHeartbeat = 3; // PLEASE KEEP THIS MATCHING THE DOC ABOVE
83+
/// seconds, with zero meaning none (value: 0)</summary>
84+
public const ushort DefaultHeartbeat = 0; // PLEASE KEEP THIS MATCHING THE DOC ABOVE
8585

8686
private string m_userName = DefaultUser;
8787
private string m_password = DefaultPass;
8888
private string m_virtualHost = DefaultVHost;
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
{

0 commit comments

Comments
 (0)