@@ -67,36 +67,47 @@ namespace RabbitMQ.Client
67
67
public class SslOption
68
68
{
69
69
70
- private SslProtocols m_sslVersion = SslProtocols . Ssl3 ;
70
+ private bool m_enabled ;
71
+
72
+ ///<summary>Flag specifying if Ssl should indeed be
73
+ ///used</summary>
74
+ public bool Enabled
75
+ {
76
+ get { return m_enabled ; }
77
+ set { m_enabled = value ; }
78
+ }
79
+
80
+
81
+ private SslProtocols m_version = SslProtocols . Ssl3 ;
71
82
72
83
///<summary>Retrieve or set the path to client certificate.
73
84
///</summary>
74
- public SslProtocols SslVersion
85
+ public SslProtocols Version
75
86
{
76
- get { return m_sslVersion ; }
77
- set { m_sslVersion = value ; }
87
+ get { return m_version ; }
88
+ set { m_version = value ; }
78
89
}
79
90
80
- private string m_cert ;
91
+ private string m_certPath ;
81
92
82
93
///<summary>Retrieve or set the path to client certificate.
83
94
///</summary>
84
- public string Cert
95
+ public string CertPath
85
96
{
86
- get { return m_cert ; }
87
- set { m_cert = value ; }
97
+ get { return m_certPath ; }
98
+ set { m_certPath = value ; }
88
99
}
89
100
90
101
///<summary>Convenience read-only property to retrieve an X509CertificateCollection
91
102
///containing the client certificate</summary>
92
- public X509CertificateCollection CertCollection
103
+ public X509CertificateCollection Certs
93
104
{
94
105
get {
95
- if ( m_cert == "" ) {
106
+ if ( m_certPath == "" ) {
96
107
return null ;
97
108
} else {
98
109
X509CertificateCollection c = new X509CertificateCollection ( ) ;
99
- c . Add ( X509Certificate . CreateFromCertFile ( m_cert ) ) ;
110
+ c . Add ( X509Certificate . CreateFromCertFile ( m_certPath ) ) ;
100
111
return c ;
101
112
}
102
113
}
@@ -109,24 +120,31 @@ public X509CertificateCollection CertCollection
109
120
public string ServerName
110
121
{
111
122
get { return m_serverName ; }
112
- set { m_serverName = value ; }
123
+ set { m_serverName = value ; }
113
124
}
114
125
115
126
127
+
128
+ ///<summary>Construct an SslOption specifying both the server cannonical name
129
+ ///and the client's certificate path.
130
+ ///</summary>
131
+ public SslOption ( string serverName , string certPath , bool enabled )
132
+ {
133
+ m_serverName = serverName ;
134
+ m_certPath = certPath ;
135
+ m_enabled = enabled ;
136
+ }
137
+
116
138
///<summary>Construct an SslOption with just the server cannonical name.
117
139
///The Certificate path is set to an empty string
118
140
///</summary>
119
- public SslOption ( string serverName ) : this ( serverName , "" )
141
+ public SslOption ( string serverName ) : this ( serverName , "" , false )
120
142
{
121
143
}
122
144
123
- ///<summary>Construct an SslOption specifying both the server cannonical name
124
- ///and the client's certificate path.
125
- ///</summary>
126
- public SslOption ( string serverName , string cert )
145
+ ///<summary>Construct an SslOption with no parameters set</summary>
146
+ public SslOption ( ) : this ( "" , "" , false )
127
147
{
128
- m_serverName = serverName ;
129
- m_cert = cert ;
130
148
}
131
149
132
150
}
0 commit comments