質問編集履歴
5
エラーに対する追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,6 +16,8 @@
|
|
16
16
|
|
17
17
|
###発生している問題・エラーメッセージ
|
18
18
|
|
19
|
+
curlには以下のようなエラーが出ました。
|
20
|
+
|
19
21
|
|
20
22
|
|
21
23
|
```
|
4
curlのコマンドに-vを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,9 +4,9 @@
|
|
4
4
|
|
5
5
|
|
6
6
|
|
7
|
-
```
|
7
|
+
```
|
8
|
-
|
8
|
+
|
9
|
-
curl --proxy-insecure -x https://localhost -L http://google.com
|
9
|
+
curl -v --proxy-insecure -x https://localhost -L http://google.com
|
10
10
|
|
11
11
|
```
|
12
12
|
|
@@ -20,6 +20,160 @@
|
|
20
20
|
|
21
21
|
```
|
22
22
|
|
23
|
+
* Rebuilt URL to: http://google.com/
|
24
|
+
|
25
|
+
* Trying ::1...
|
26
|
+
|
27
|
+
* TCP_NODELAY set
|
28
|
+
|
29
|
+
* Connected to localhost (::1) port 443 (#0)
|
30
|
+
|
31
|
+
* successfully set certificate verify locations:
|
32
|
+
|
33
|
+
* CAfile: /etc/ssl/certs/ca-certificates.crt
|
34
|
+
|
35
|
+
CApath: none
|
36
|
+
|
37
|
+
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
|
38
|
+
|
39
|
+
* TLSv1.2 (IN), TLS handshake, Server hello (2):
|
40
|
+
|
41
|
+
* TLSv1.2 (IN), TLS handshake, Certificate (11):
|
42
|
+
|
43
|
+
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
|
44
|
+
|
45
|
+
* TLSv1.2 (IN), TLS handshake, Server finished (14):
|
46
|
+
|
47
|
+
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
|
48
|
+
|
49
|
+
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
|
50
|
+
|
51
|
+
* TLSv1.2 (OUT), TLS handshake, Finished (20):
|
52
|
+
|
53
|
+
* TLSv1.2 (IN), TLS handshake, Finished (20):
|
54
|
+
|
55
|
+
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
|
56
|
+
|
57
|
+
* Proxy certificate:
|
58
|
+
|
59
|
+
* subject: //
|
60
|
+
|
61
|
+
* start date: Oct 4 22:59:50 2017 GMT
|
62
|
+
|
63
|
+
* expire date: Oct 4 22:59:50 2018 GMT
|
64
|
+
|
65
|
+
* issuer: //
|
66
|
+
|
67
|
+
* SSL certificate verify result: self signed certificate (18), continuing anyway.
|
68
|
+
|
69
|
+
> GET http://google.com/ HTTP/1.1
|
70
|
+
|
71
|
+
> Host: google.com
|
72
|
+
|
73
|
+
> User-Agent: curl/7.56.0
|
74
|
+
|
75
|
+
> Accept: */*
|
76
|
+
|
77
|
+
> Proxy-Connection: Keep-Alive
|
78
|
+
|
79
|
+
>
|
80
|
+
|
81
|
+
< HTTP/1.1 302 Found
|
82
|
+
|
83
|
+
< cache-control: private
|
84
|
+
|
85
|
+
< content-type: text/html; charset=UTF-8
|
86
|
+
|
87
|
+
< referrer-policy: no-referrer
|
88
|
+
|
89
|
+
< location: https://www.google.co.jp/?gfe_rd=cr&dcr=0&ei=SRrxWYrHMbHU8AeByq2ABg
|
90
|
+
|
91
|
+
< content-length: 272
|
92
|
+
|
93
|
+
< date: Wed, 25 Oct 2017 23:12:09 GMT
|
94
|
+
|
95
|
+
< alt-svc: quic=":443"; ma=2592000; v="39,38,37,35"
|
96
|
+
|
97
|
+
< connection: close
|
98
|
+
|
99
|
+
<
|
100
|
+
|
101
|
+
* Closing connection 0
|
102
|
+
|
103
|
+
* TLSv1.2 (OUT), TLS alert, Client hello (1):
|
104
|
+
|
105
|
+
* Issue another request to this URL: 'https://www.google.co.jp/?gfe_rd=cr&dcr=0&ei=SRrxWYrHMbHU8AeByq2ABg'
|
106
|
+
|
107
|
+
* Hostname localhost was found in DNS cache
|
108
|
+
|
109
|
+
* Trying ::1...
|
110
|
+
|
111
|
+
* TCP_NODELAY set
|
112
|
+
|
113
|
+
* Connected to localhost (::1) port 443 (#1)
|
114
|
+
|
115
|
+
* ALPN, offering http/1.1
|
116
|
+
|
117
|
+
* successfully set certificate verify locations:
|
118
|
+
|
119
|
+
* CAfile: /etc/ssl/certs/ca-certificates.crt
|
120
|
+
|
121
|
+
CApath: none
|
122
|
+
|
123
|
+
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
|
124
|
+
|
125
|
+
* TLSv1.2 (IN), TLS handshake, Server hello (2):
|
126
|
+
|
127
|
+
* TLSv1.2 (IN), TLS handshake, Certificate (11):
|
128
|
+
|
129
|
+
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
|
130
|
+
|
131
|
+
* TLSv1.2 (IN), TLS handshake, Server finished (14):
|
132
|
+
|
133
|
+
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
|
134
|
+
|
135
|
+
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
|
136
|
+
|
137
|
+
* TLSv1.2 (OUT), TLS handshake, Finished (20):
|
138
|
+
|
139
|
+
* TLSv1.2 (IN), TLS handshake, Finished (20):
|
140
|
+
|
141
|
+
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
|
142
|
+
|
143
|
+
* ALPN, server accepted to use http/1.1
|
144
|
+
|
145
|
+
* Proxy certificate:
|
146
|
+
|
147
|
+
* subject: //ここは隠します
|
148
|
+
|
149
|
+
* start date: Oct 4 22:59:50 2017 GMT
|
150
|
+
|
151
|
+
* expire date: Oct 4 22:59:50 2018 GMT
|
152
|
+
|
153
|
+
* issuer: // ここは隠します
|
154
|
+
|
155
|
+
* SSL certificate verify result: self signed certificate (18), continuing anyway.
|
156
|
+
|
157
|
+
* allocate connect buffer!
|
158
|
+
|
159
|
+
* Establish HTTP proxy tunnel to www.google.co.jp:443
|
160
|
+
|
161
|
+
> CONNECT www.google.co.jp:443 HTTP/1.1
|
162
|
+
|
163
|
+
> Host: www.google.co.jp:443
|
164
|
+
|
165
|
+
> User-Agent: curl/7.56.0
|
166
|
+
|
167
|
+
> Proxy-Connection: Keep-Alive
|
168
|
+
|
169
|
+
>
|
170
|
+
|
171
|
+
* Proxy CONNECT aborted
|
172
|
+
|
173
|
+
* CONNECT phase completed!
|
174
|
+
|
175
|
+
* Connection #1 to host localhost left intact
|
176
|
+
|
23
177
|
curl: (56) Proxy CONNECT aborted
|
24
178
|
|
25
179
|
```
|
3
docker-compose 周りのコメントを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -38,15 +38,15 @@
|
|
38
38
|
|
39
39
|
var config = {
|
40
40
|
|
41
|
-
port: process.env['PORT'],
|
41
|
+
port: process.env['PORT'], // 443
|
42
42
|
|
43
43
|
|
44
44
|
|
45
45
|
ssl: {
|
46
46
|
|
47
|
-
key: fs.readFileSync(__dirname + process.env['SSL_KEY'], 'utf8'),
|
47
|
+
key: fs.readFileSync(__dirname + process.env['SSL_KEY'], 'utf8'), // ssl key
|
48
48
|
|
49
|
-
cert: fs.readFileSync(__dirname + process.env['SSL_CERT'], 'utf8')
|
49
|
+
cert: fs.readFileSync(__dirname + process.env['SSL_CERT'], 'utf8') // ssl cert
|
50
50
|
|
51
51
|
}
|
52
52
|
|
2
タイトルをより明確にした
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Node.jsでhttpsプロキシを立て
|
1
|
+
Node.jsでhttpsプロキシを立てcurlで繋ぐと、curl側でエラーが出てしまう
|
test
CHANGED
File without changes
|
1
curlで使ったコマンドを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
###前提・実現したいこと
|
2
2
|
|
3
|
-
HTTPSでクライアント及びgoogle.comに接続するLプロキシを書こうとしたのですが、デバッグとしてcurlで繋
|
3
|
+
HTTPSでクライアント及びgoogle.comに接続するLプロキシを書こうとしたのですが、デバッグとして以下のコマンドでcurlで繋ごうとしたところ、エラーが出てしまいます。
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
```shell
|
8
|
+
|
9
|
+
curl --proxy-insecure -x https://localhost -L http://google.com
|
10
|
+
|
11
|
+
```
|
12
|
+
|
13
|
+
|
4
14
|
|
5
15
|
|
6
16
|
|