@@ -21,7 +21,7 @@ namespace Titanium.Web.Proxy
21
21
/// </summary>
22
22
public partial class ProxyServer
23
23
{
24
- private static readonly int BUFFER_SIZE = 8192 ;
24
+
25
25
private static readonly char [ ] SemiSplit = { ';' } ;
26
26
27
27
private static readonly string [ ] ColonSpaceSplit = { ": " } ;
@@ -34,17 +34,16 @@ public partial class ProxyServer
34
34
private static readonly byte [ ] ChunkEnd =
35
35
Encoding . ASCII . GetBytes ( 0 . ToString ( "x2" ) + Environment . NewLine + Environment . NewLine ) ;
36
36
37
+ public static readonly int BUFFER_SIZE = 8192 ;
37
38
#if NET45
38
39
internal static SslProtocols SupportedProtocols = SslProtocols . Tls | SslProtocols . Tls11 | SslProtocols . Tls12 | SslProtocols . Ssl3 ;
39
40
#else
40
- public static SslProtocols SupportedProtocols = SslProtocols . Tls | SslProtocols . Ssl3 ;
41
+ internal static SslProtocols SupportedProtocols = SslProtocols . Tls | SslProtocols . Ssl3 ;
41
42
#endif
42
43
43
44
static ProxyServer ( )
44
45
{
45
- CertManager = new CertificateManager ( "Titanium" ,
46
- "Titanium Root Certificate Authority" ) ;
47
-
46
+
48
47
ProxyEndPoints = new List < ProxyEndPoint > ( ) ;
49
48
50
49
Initialize ( ) ;
@@ -55,6 +54,7 @@ static ProxyServer()
55
54
private static bool certTrusted { get ; set ; }
56
55
private static bool proxyRunning { get ; set ; }
57
56
57
+ public static string RootCertificateIssuerName { get ; set ; }
58
58
public static string RootCertificateName { get ; set ; }
59
59
60
60
public static event EventHandler < SessionEventArgs > BeforeRequest ;
@@ -123,7 +123,6 @@ public static void SetAsSystemHttpsProxy(ExplicitProxyEndPoint endPoint)
123
123
//clear any settings previously added
124
124
ProxyEndPoints . OfType < ExplicitProxyEndPoint > ( ) . ToList ( ) . ForEach ( x => x . IsSystemHttpsProxy = false ) ;
125
125
126
- RootCertificateName = RootCertificateName ?? "Titanium_Proxy_Test_Root" ;
127
126
128
127
//If certificate was trusted by the machine
129
128
if ( certTrusted )
@@ -156,6 +155,12 @@ public static void Start()
156
155
if ( proxyRunning )
157
156
throw new Exception ( "Proxy is already running." ) ;
158
157
158
+ RootCertificateName = RootCertificateName ?? "Titanium Root Certificate Authority" ;
159
+ RootCertificateIssuerName = RootCertificateIssuerName ?? "Titanium" ;
160
+
161
+ CertManager = new CertificateManager ( RootCertificateIssuerName ,
162
+ RootCertificateName ) ;
163
+
159
164
EnableSsl = ProxyEndPoints . Any ( x => x . EnableSsl ) ;
160
165
161
166
if ( EnableSsl )
0 commit comments