Skip to content

Commit 6e2af4e

Browse files
author
Emile Joubert
committed
Merged bug23013 into default
2 parents 5a2c068 + 853ce08 commit 6e2af4e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

projects/client/RabbitMQ.Client/src/client/api/AmqpTcpEndpoint.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ namespace RabbitMQ.Client
7474
public class AmqpTcpEndpoint
7575
{
7676
///<summary>Indicates that the default port for the protocol should be used</summary>
77+
public const int DefaultAmqpSslPort = 5671;
7778
public const int UseDefaultPort = -1;
7879

7980
private IProtocol m_protocol;
@@ -98,7 +99,13 @@ public string HostName
9899
///port number for the IProtocol to be used.</summary>
99100
public int Port
100101
{
101-
get { return (m_port == UseDefaultPort) ? m_protocol.DefaultPort : m_port; }
102+
get {
103+
if (m_port != UseDefaultPort)
104+
return m_port;
105+
if (m_ssl.Enabled)
106+
return DefaultAmqpSslPort;
107+
return m_protocol.DefaultPort;
108+
}
102109
set { m_port = value; }
103110
}
104111

projects/client/RabbitMQ.Client/src/client/api/ConnectionFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,14 @@ public AmqpTcpEndpoint Endpoint
165165
{
166166
get
167167
{
168-
return new AmqpTcpEndpoint(Protocol, HostName, Port);
168+
return new AmqpTcpEndpoint(Protocol, HostName, Port, Ssl);
169169
}
170170
set
171171
{
172172
Protocol = value.Protocol;
173173
Port = value.Port;
174174
HostName = value.HostName;
175+
Ssl = value.Ssl;
175176
}
176177
}
177178

0 commit comments

Comments
 (0)