FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
NetCoreServer/source/NetCoreServer/SslContext.cs at master · uServe-UP/NetCoreServer · GitHub
uServe-UP
NetCoreServer
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
NetCoreServer
/
source
/
NetCoreServer
/
SslContext.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
81 lines (78 loc) · 3.56 KB
Breadcrumbs
NetCoreServer
/
source
/
NetCoreServer
/
SslContext.cs
Copy path
File metadata and controls
81 lines (78 loc) · 3.56 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
using
System
.
Net
.
Security
;
using
System
.
Security
.
Authentication
;
using
System
.
Security
.
Cryptography
.
X509Certificates
;
namespace
NetCoreServer
{
/// <summary>
/// SSL context
/// </summary>
public
class
SslContext
{
/// <summary>
/// Initialize SSL context with default protocols
/// </summary>
public
SslContext
(
)
:
this
(
SslProtocols
.
Tls12
)
{
}
/// <summary>
/// Initialize SSL context with given protocols
/// </summary>
/// <param name="protocols">SSL protocols</param>
public
SslContext
(
SslProtocols
protocols
)
{
Protocols
=
protocols
;
}
/// <summary>
/// Initialize SSL context with given protocols and certificate
/// </summary>
/// <param name="protocols">SSL protocols</param>
/// <param name="certificate">SSL certificate</param>
public
SslContext
(
SslProtocols
protocols
,
X509Certificate
certificate
)
:
this
(
protocols
,
certificate
,
null
)
{
}
/// <summary>
/// Initialize SSL context with given protocols, certificate and validation callback
/// </summary>
/// <param name="protocols">SSL protocols</param>
/// <param name="certificate">SSL certificate</param>
/// <param name="certificateValidationCallback">SSL certificate</param>
public
SslContext
(
SslProtocols
protocols
,
X509Certificate
certificate
,
RemoteCertificateValidationCallback
certificateValidationCallback
)
{
Protocols
=
protocols
;
Certificate
=
certificate
;
CertificateValidationCallback
=
certificateValidationCallback
;
}
/// <summary>
/// Initialize SSL context with given protocols and certificates collection
/// </summary>
/// <param name="protocols">SSL protocols</param>
/// <param name="certificates">SSL certificates collection</param>
public
SslContext
(
SslProtocols
protocols
,
X509Certificate2Collection
certificates
)
:
this
(
protocols
,
certificates
,
null
)
{
}
/// <summary>
/// Initialize SSL context with given protocols, certificates collection and validation callback
/// </summary>
/// <param name="protocols">SSL protocols</param>
/// <param name="certificates">SSL certificates collection</param>
/// <param name="certificateValidationCallback">SSL certificate</param>
public
SslContext
(
SslProtocols
protocols
,
X509Certificate2Collection
certificates
,
RemoteCertificateValidationCallback
certificateValidationCallback
)
{
Protocols
=
protocols
;
Certificates
=
certificates
;
CertificateValidationCallback
=
certificateValidationCallback
;
}
/// <summary>
/// SSL protocols
/// </summary>
public
SslProtocols
Protocols
{
get
;
set
;
}
/// <summary>
/// SSL certificate
/// </summary>
public
X509Certificate
Certificate
{
get
;
set
;
}
/// <summary>
/// SSL certificates collection
/// </summary>
public
X509Certificate2Collection
Certificates
{
get
;
set
;
}
/// <summary>
/// SSL certificate validation callback
/// </summary>
public
RemoteCertificateValidationCallback
CertificateValidationCallback
{
get
;
set
;
}
/// <summary>
/// Is the client is asked for a certificate for authentication.
/// Note that this is only a request - if no certificate is provided, the server still accepts the connection request.
/// </summary>
public
bool
ClientCertificateRequired
{
get
;
set
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL