@@ -54,85 +54,85 @@ export class CertCheckServer {
5454
5555 const certificatePem = await readFile ( this . config . https . certPath ) ;
5656
57- this . server . get ( '/test-https' ) . thenReply ( 200 ) ;
58-
59- this . server . get ( '/download-cert' ) . thenReply ( 200 , certificatePem , {
60- 'Content-type' : 'application/x-x509-ca-cert'
61- } ) ;
62-
63- this . server . get ( '/check-cert' ) . thenReply ( 200 , `
64- <html >
65- <title>HTTP Toolkit Certificate Setup</title >
66- <meta charset="UTF-8 " />
67- <link href="http://fonts.googleapis.com/css?family=Lato" rel="stylesheet" / >
68- <style>
69- body {
70- margin: 20px ;
71- background-color: #d8e2e6 ;
72- font-family: Lato, Arial;
73- }
74-
75- body:not(.show-content) > * {
76- display: none;
77- }
78-
79- h1 {
80- font-size: 36pt;
81- }
82-
83- p {
84- font-size: 16pt;
85- }
86-
87- iframe {
88- display: none;
89- }
90- </style >
91- <script>
92- let installingCert = false ;
93- const targetUrl = ${ JSON . stringify ( targetUrl ) } ;
94-
95- ${ ensureCertificateIsInstalled . toString ( ) }
96- ensureCertificateIsInstalled();
97- </script >
98- <body >
99- <h1>
100- Configuring Firefox to use HTTP Toolkit
101- </h1 >
102- <p>
103- To intercept HTTPS traffic, you need to trust the HTTP Toolkit certificate.
104- </ p>
105- <p>
106- Select 'Trust this CA to identify web sites' and press 'OK' to continue.
107- </p>
108-
109- <svg
110- version="1.1 "
111- xmlns="http://www.w3.org/2000/svg "
112- xmlns:xlink="http://www.w3.org/1999/xlink "
113- x ="0px"
114- y="0px "
115- width ="400px"
116- height="400px "
117- viewBox=" 0 0 50 50"
118- style="enable-background:new 0 0 50 50;"
119- >
120- <path fill="#b6c2ca" d="M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z">
121- <animateTransform
122- attributeType="xml "
123- attributeName="transform "
124- type="rotate "
125- from="0 25 25"
126- to="360 25 25 "
127- dur="6s "
128- repeatCount="indefinite"
129- / >
130- </path >
131- </svg >
132- </div >
133- </body >
134- </html>
135- ` ) ;
57+ await Promise . all ( [
58+ this . server . get ( '/test-https' ) . thenReply ( 200 ) ,
59+ this . server . get ( '/download-cert' ) . thenReply ( 200 , certificatePem , {
60+ 'Content-type' : 'application/x-x509-ca-cert'
61+ } ) ,
62+ this . server . get ( '/check-cert' ) . thenReply ( 200 , `
63+ <html>
64+ <title>HTTP Toolkit Certificate Setup</title >
65+ <meta charset="UTF-8" / >
66+ <link href="http://fonts.googleapis.com/css?family=Lato" rel="stylesheet " />
67+ <style >
68+ body {
69+ margin: 20px;
70+ background-color: #d8e2e6 ;
71+ font-family: Lato, Arial ;
72+ }
73+
74+ body:not(.show-content) > * {
75+ display: none;
76+ }
77+
78+ h1 {
79+ font-size: 36pt;
80+ }
81+
82+ p {
83+ font-size: 16pt;
84+ }
85+
86+ iframe {
87+ display: none;
88+ }
89+ </style>
90+ <script >
91+ let installingCert = false;
92+ const targetUrl = ${ JSON . stringify ( targetUrl ) } ;
93+
94+ ${ ensureCertificateIsInstalled . toString ( ) }
95+ ensureCertificateIsInstalled();
96+ </script>
97+ <body >
98+ <h1 >
99+ Configuring Firefox to use HTTP Toolkit
100+ </h1>
101+ <p >
102+ To intercept HTTPS traffic, you need to trust the HTTP Toolkit certificate.
103+ </p>
104+ < p>
105+ Select 'Trust this CA to identify web sites' and press 'OK' to continue.
106+ </p>
107+
108+ <svg
109+ version="1.1"
110+ xmlns="http://www.w3.org/2000/svg "
111+ xmlns:xlink ="http://www.w3.org/1999/xlink "
112+ x="0px "
113+ y ="0px"
114+ width="400px "
115+ height ="400px"
116+ viewBox="0 0 50 50 "
117+ style="enable-background:new 0 0 50 50; "
118+ >
119+ <path fill="#b6c2ca" d="M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z" >
120+ <animateTransform
121+ attributeType="xml"
122+ attributeName="transform "
123+ type="rotate "
124+ from="0 25 25 "
125+ to="360 25 25"
126+ dur="6s "
127+ repeatCount="indefinite "
128+ />
129+ </path >
130+ </svg >
131+ </div >
132+ </body >
133+ </html >
134+ ` )
135+ ] ) ;
136136 }
137137
138138 get host ( ) : string {
0 commit comments