Page 1 of 1

プロキシ環境下+Apacheリバースプロキシでサーバへ接続できない

Posted: Thu Dec 27, 2018 3:41 am
by kazuki
初めまして

現在,施設のプロキシ環境下+サーバ側はリバースプロキシ構成で使っているのですが,
特定の環境下でサーバへ接続できません.

サーバは自宅のWindowsですが,他のWEBサーバもあるためVirtualHostをUbuntuに設定しております.

ネットワーク構成は
自宅LAN内IP(ゲートウェイLAN側:192.168.1.1/24)
Ubuntu(192.168.1.11)
SoftEther鯖用Windows(192.168.1.2)

ルータではグローバル側の443番ポートへ来た通信をすべてUbuntuに流すようにポート開放してあります.

UbuntuではApacheのVirutalHostを使って,
vpn.Myドメイン.jp -> 192.168.1.2 (リバースプロキシ)
Myドメイン.jp -> 192.168.1.11 (Apache自身が処理)
という風に設定してあります.

この構成で,例えばスマホのテザリングや,別の施設のプロキシ環境下ではVPNは正常に張れるのですが,

とある施設のプロキシを通すとつながりはするものの,VPNが正常に張れていないようです.
(pingが一切通りませんし,DHCPからアドレスも落ちてきません)
(クライアント接続マネージャ上では「接続完了」となります.接続状況を見ると,送信データサイズが数kB/sくらいの割合で増加,受信は944バイトで止まったままです.ブロードキャストも含め受信はすべて停止,送信はどれも少しずつ増加)

尚,Firefoxでvpn.Myドメイン.jpへアクセスすると

Forbidden
You don't have permission to access / on this server.
HTTP Server at 192.168.1.2 Port 443

と帰ってくるのでSoftetherVPNの鯖へ到達することはできているのだろうと予想しています.(192.168.1.2上で他にhttpsサーバはありません)

クライアント・サーバVer:4.25 Build9656

ApacheのVirtualHostの設定は一番上に↓を書いています.
(一番上を別の設定(サブドメイン無し)にすると繋がらなくなるのでSNIがうまく動いていないのかな?という気がしますが…)

<VirtualHost *:443>
ServerName vpn.Myドメイン.jp
ProxyPreserveHosdt On
ProxyPass / https://192.168.1.2/ timeout=3600
ProxyPassReverse / https://192.168.1.2

SSLProxyEngine on
SSLProxyCheckPeeCN off
SSLProxyCheckPeerName off

SSLCertificateFile /.../...../cert.pem
SSLCertificateKeyFile /.../....../privkey.pem

ErrorLog ....(略)
CustomLog ......(略)
LogLevel warn
</VirtualHost>

尚,TeraTailで質問もしました.
https://teratail.com/questions/165159#
リバースプロキシをSSL化する前は「接続完了」すら出ない状態でした.
しかし,現在,接続完了とはなるものの,実際にはVPNが張れていないので解決していません.

他にどのような情報が必要でしょうか
よろしくお願いします.

Re: プロキシ環境下+Apacheリバースプロキシでサーバへ接続できない

Posted: Thu Dec 27, 2018 4:08 am
by cedar
プロクシまたはリバースプロクシのログは確認されたでしょうか。

Re: プロキシ環境下+Apacheリバースプロキシでサーバへ接続できない

Posted: Thu Dec 27, 2018 6:35 am
by kazuki
プロキシは施設のものなので私は触れません.

リバースプロキシのエラーログは以下です.
同じ内容のメッセージがたくさんあったので,抽出したためPIDがおかしいかもしれません(時系列はいじってません)

[Thu Dec 27 15:27:57.975956 2018] [proxy_http:error] [pid 14308] (104)Connection reset by peer: [client 000.000.000.000:40164] AH01102: error reading status line from remote server 192.168.1.2:443
[Thu Dec 27 15:27:57.976003 2018] [proxy:error] [pid 14308] [client 000.000.000.000:40164] AH00898: Error reading from remote server returned by /vpnsvc/connect.cgi
[Thu Dec 27 15:28:03.331510 2018] [proxy:warn] [pid 18916] AH03408: HTTPS: reusable backend connection is not empty: forcibly closed

よろしくお願いします.

Re: プロキシ環境下+Apacheリバースプロキシでサーバへ接続できない

Posted: Thu Dec 27, 2018 6:48 am
by cedar
SNIで振り分けているのだとすると、URLのパス部分が見えているのがおかしいですね。
ApacheがSSLをデコードしてしまっているように見えます。

Re: プロキシ環境下+Apacheリバースプロキシでサーバへ接続できない

Posted: Thu Dec 27, 2018 8:41 am
by kazuki
回答ありがとうございます

いったんログをクリアしてから再度実行してみたところ,
エラーログではなく,access.logのほうにはこんな風になっていました.

000.00.00.00 - - [27/Dec/2018:17:38:05 +0900] "POST /vpnsvc/connect.cgi HTTP/1.1" 200 2307 "-" "-"
000.00.00.00 - - [27/Dec/2018:17:38:05 +0900] "POST /vpnsvc/vpn.cgi HTTP/1.1" 200 375 "-" "-"
000.00.00.00 - - [27/Dec/2018:17:38:05 +0900] "\xff\xff\xff\xff" 400 0 "-" "-"
000.00.00.00 - - [27/Dec/2018:17:38:06 +0900] "POST /vpnsvc/connect.cgi HTTP/1.1" 200 2490 "-" "-"
000.00.00.00 - - [27/Dec/2018:17:38:06 +0900] "POST /vpnsvc/vpn.cgi HTTP/1.1" 200 311 "-" "-"
000.00.00.00 - - [27/Dec/2018:17:38:07 +0900] "POST /vpnsvc/connect.cgi HTTP/1.1" 200 2613 "-" "-"
000.00.00.00 - - [27/Dec/2018:17:38:07 +0900] "POST /vpnsvc/vpn.cgi HTTP/1.1" 200 321 "-" "-"
000.00.00.00 - - [27/Dec/2018:17:38:08 +0900] "POST /vpnsvc/connect.cgi HTTP/1.1" 200 1992 "-" "-"
000.00.00.00 - - [27/Dec/2018:17:38:08 +0900] "POST /vpnsvc/vpn.cgi HTTP/1.1" 200 1165 "-" "-"
↑IPアドレス

これは正常に接続できているPCも,
うまく接続できないPCも,
メッセージの内容は同じでした.

ここのURLのパス部分が見えていますが,これは問題ないでしょうか

Re: プロキシ環境下+Apacheリバースプロキシでサーバへ接続できない

Posted: Thu Dec 27, 2018 10:05 am
by kazuki
少し情報を整理したく,次のようにApacheの設定を変更し,ログをクリアしてからやり直してみました.
ログが長く見づらいとは思いますが,どうぞよろしくお願いします.

施設②からは接続でき,施設①からは接続できない点が不思議に思っています
http://www.playstudy.net/blog/develop/p ... ocket.html
こういうのも関係しているのでしょうか…


変更した点
・リバースプロキシにSSLを明示しなくした
・VirtualHostの設定の順序を変えた(Myドメイン.jpを一番上に,vpn.Myドメイン.jpをその下に)

----/etc/apache2/sites-enabled/virtual.conf----
NameVirtualHost *:443
<VirtualHost *:443>
ServerName mydomain.jp
SSLEngine on
SSLCertificateFile /................/cert.pem
SSLCertificateKeyFile /......................./privkey.pem
Header set Strict-Transport-Security "max-age=0;"
ServerAdmin webmaster2@virtual.host
DocumentRoot /var/www/..........
ErrorLog /var/log/apache2/virtual.host.error.log
CustomLog /var/log/apache2/virtual.host.access.log combined
LogLevel debug
</VirtualHost>
<VirtualHost *:443>
ServerName vpn.mydomain.jp
ProxyPreserveHost On
ProxyPass / https://192.168.1.2/ timeout=3600
ProxyPassReverse / https://192.168.1.2/

ErrorLog /var/log/apache2/vpn.error.log
CustomLog /var/log/apache2/vpn.access.log combined
LogLevel debug
</VirtualHost>

この状態で,施設①のプロキシ経由だと接続できません
しかし,施設②のネット環境(WiFiですがおそらくプロキシは入っていると思います)では接続できました.

/var/log/apache2/には合計6つのログファイルがあります
これはログ削除→Apache再起動直後(すなわちどこからもアクセスされていない状態)です

-------------------------------------
$ ll
-------------------------------------
drwxr-x--- 2 root adm 4096 12月 27 18:47 ./
drwxrwxr-x 16 root syslog 4096 12月 27 00:10 ../
-rw-r--r-- 1 root root 5605 12月 27 18:47 error.log
-rw-r--r-- 1 root root 0 12月 27 18:47 other_vhosts_access.log
-rw-r--r-- 1 root root 0 12月 27 18:47 virtual.host.access.log
-rw-r--r-- 1 root root 1954 12月 27 18:47 virtual.host.error.log
-rw-r--r-- 1 root root 0 12月 27 18:47 vpn.access.log
-rw-r--r-- 1 root root 2140 12月 27 18:47 vpn.error.log


-------------------------------------
error.log
-------------------------------------
[Thu Dec 27 18:47:48.955228 2018] [ssl:info] [pid 9529] AH01887: Init: Initializing (virtual) servers for SSL
[Thu Dec 27 18:47:48.955558 2018] [ssl:info] [pid 9529] AH01876: mod_ssl/2.4.29 compiled against Server: Apache/2.4.29, Library: OpenSSL/1.1.0g
[Thu Dec 27 18:47:48.979960 2018] [socache_shmcb:debug] [pid 9530] mod_socache_shmcb.c(401): AH00821: shmcb_init allocated 512000 bytes of shared memory
[Thu Dec 27 18:47:48.979975 2018] [socache_shmcb:debug] [pid 9530] mod_socache_shmcb.c(417): AH00822: for 511912 bytes (512000 including header), recommending 32 subcaches, 88 indexes each
[Thu Dec 27 18:47:48.979978 2018] [socache_shmcb:debug] [pid 9530] mod_socache_shmcb.c(450): AH00824: shmcb_init_memory choices follow
[Thu Dec 27 18:47:48.979980 2018] [socache_shmcb:debug] [pid 9530] mod_socache_shmcb.c(452): AH00825: subcache_num = 32
[Thu Dec 27 18:47:48.979983 2018] [socache_shmcb:debug] [pid 9530] mod_socache_shmcb.c(454): AH00826: subcache_size = 15992
[Thu Dec 27 18:47:48.979985 2018] [socache_shmcb:debug] [pid 9530] mod_socache_shmcb.c(456): AH00827: subcache_data_offset = 2128
[Thu Dec 27 18:47:48.979987 2018] [socache_shmcb:debug] [pid 9530] mod_socache_shmcb.c(458): AH00828: subcache_data_size = 13864
[Thu Dec 27 18:47:48.979989 2018] [socache_shmcb:debug] [pid 9530] mod_socache_shmcb.c(460): AH00829: index_num = 88
[Thu Dec 27 18:47:48.980031 2018] [socache_shmcb:info] [pid 9530] AH00830: Shared memory socache initialised
[Thu Dec 27 18:47:48.980034 2018] [ssl:info] [pid 9530] AH01887: Init: Initializing (virtual) servers for SSL
[Thu Dec 27 18:47:48.980345 2018] [ssl:info] [pid 9530] AH01876: mod_ssl/2.4.29 compiled against Server: Apache/2.4.29, Library: OpenSSL/1.1.0g
[Thu Dec 27 18:47:48.980363 2018] [watchdog:debug] [pid 9530] mod_watchdog.c(454): AH010033: Watchdog: Running with WatchdogInterval 1000ms
[Thu Dec 27 18:47:48.980368 2018] [watchdog:debug] [pid 9530] mod_watchdog.c(462): AH02974: Watchdog: found parent providers.
[Thu Dec 27 18:47:48.980371 2018] [watchdog:debug] [pid 9530] mod_watchdog.c(508): AH02977: Watchdog: found child providers.
[Thu Dec 27 18:47:48.980374 2018] [watchdog:debug] [pid 9530] mod_watchdog.c(516): AH02978: Watchdog: Looking for child (_singleton_).
[Thu Dec 27 18:47:48.980376 2018] [watchdog:debug] [pid 9530] mod_watchdog.c(516): AH02978: Watchdog: Looking for child (_default_).
[Thu Dec 27 18:47:48.981880 2018] [watchdog:debug] [pid 9531] mod_watchdog.c(565): AH02980: Watchdog: nothing configured?
[Thu Dec 27 18:47:48.981943 2018] [proxy:debug] [pid 9531] proxy_util.c(1785): AH00925: initializing worker proxy:reverse shared
[Thu Dec 27 18:47:48.981950 2018] [proxy:debug] [pid 9531] proxy_util.c(1827): AH00927: initializing worker proxy:reverse local
[Thu Dec 27 18:47:48.981972 2018] [proxy:debug] [pid 9531] proxy_util.c(1878): AH00931: initialized single connection worker in child 9531 for (*)
[Thu Dec 27 18:47:48.982096 2018] [watchdog:debug] [pid 9532] mod_watchdog.c(565): AH02980: Watchdog: nothing configured?
[Thu Dec 27 18:47:48.982166 2018] [proxy:debug] [pid 9532] proxy_util.c(1785): AH00925: initializing worker proxy:reverse shared
[Thu Dec 27 18:47:48.982175 2018] [proxy:debug] [pid 9532] proxy_util.c(1827): AH00927: initializing worker proxy:reverse local
[Thu Dec 27 18:47:48.982199 2018] [proxy:debug] [pid 9532] proxy_util.c(1878): AH00931: initialized single connection worker in child 9532 for (*)
[Thu Dec 27 18:47:48.982552 2018] [watchdog:debug] [pid 9533] mod_watchdog.c(565): AH02980: Watchdog: nothing configured?
[Thu Dec 27 18:47:48.982603 2018] [proxy:debug] [pid 9533] proxy_util.c(1785): AH00925: initializing worker proxy:reverse shared
[Thu Dec 27 18:47:48.982610 2018] [proxy:debug] [pid 9533] proxy_util.c(1827): AH00927: initializing worker proxy:reverse local
[Thu Dec 27 18:47:48.982626 2018] [proxy:debug] [pid 9533] proxy_util.c(1878): AH00931: initialized single connection worker in child 9533 for (*)
[Thu Dec 27 18:47:48.982795 2018] [mpm_prefork:notice] [pid 9530] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g configured -- resuming normal operations
[Thu Dec 27 18:47:48.982809 2018] [mpm_prefork:info] [pid 9530] AH00164: Server built: 2018-10-03T14:41:08
[Thu Dec 27 18:47:48.982818 2018] [core:notice] [pid 9530] AH00094: Command line: '/usr/sbin/apache2'
[Thu Dec 27 18:47:48.982822 2018] [core:debug] [pid 9530] log.c(1570): AH02639: Using SO_REUSEPORT: yes (1)
[Thu Dec 27 18:47:48.982824 2018] [mpm_prefork:debug] [pid 9530] prefork.c(923): AH00165: Accept mutex: sysvsem (default: sysvsem)
[Thu Dec 27 18:47:48.983104 2018] [watchdog:debug] [pid 9534] mod_watchdog.c(565): AH02980: Watchdog: nothing configured?
[Thu Dec 27 18:47:48.983185 2018] [proxy:debug] [pid 9534] proxy_util.c(1785): AH00925: initializing worker proxy:reverse shared
[Thu Dec 27 18:47:48.983195 2018] [proxy:debug] [pid 9534] proxy_util.c(1827): AH00927: initializing worker proxy:reverse local
[Thu Dec 27 18:47:48.983221 2018] [proxy:debug] [pid 9534] proxy_util.c(1878): AH00931: initialized single connection worker in child 9534 for (*)
[Thu Dec 27 18:47:48.983786 2018] [watchdog:debug] [pid 9535] mod_watchdog.c(565): AH02980: Watchdog: nothing configured?
[Thu Dec 27 18:47:48.983867 2018] [proxy:debug] [pid 9535] proxy_util.c(1785): AH00925: initializing worker proxy:reverse shared
[Thu Dec 27 18:47:48.983878 2018] [proxy:debug] [pid 9535] proxy_util.c(1827): AH00927: initializing worker proxy:reverse local
[Thu Dec 27 18:47:48.983904 2018] [proxy:debug] [pid 9535] proxy_util.c(1878): AH00931: initialized single connection worker in child 9535 for (*)

-------------------------------------
virtual.host.error.log
-------------------------------------
[Thu Dec 27 18:47:48.955256 2018] [ssl:info] [pid 9529] AH01914: Configuring server mydomain.jp:443 for SSL protocol
[Thu Dec 27 18:47:48.955262 2018] [ssl:debug] [pid 9529] ssl_engine_init.c(1658): AH: Init: (mydomain.jp:443) mod_md support is unavailable.
[Thu Dec 27 18:47:48.955372 2018] [ssl:debug] [pid 9529] ssl_engine_init.c(492): AH01893: Configuring TLS extension handling
[Thu Dec 27 18:47:48.955510 2018] [ssl:debug] [pid 9529] ssl_util_ssl.c(470): AH02412: [mydomain.jp:443] Cert matches for name 'mydomain.jp' [subject: CN=mydomain.jp / issuer: CN=Let's Encrypt Authority X3,O=Let's Encrypt,C=US / serial: 030B---------------------------0BBC9 / notbefore: Nov 23 13:42:28 2018 GMT / notafter: Feb 21 13:42:28 2019 GMT]
[Thu Dec 27 18:47:48.955517 2018] [ssl:info] [pid 9529] AH02568: Certificate and private key mydomain.jp:443:0 configured from /....................../cert.pem and /........................../privkey.pem
[Thu Dec 27 18:47:48.980037 2018] [ssl:info] [pid 9530] AH01914: Configuring server mydomain.jp:443 for SSL protocol
[Thu Dec 27 18:47:48.980041 2018] [ssl:debug] [pid 9530] ssl_engine_init.c(1658): AH: Init: (mydomain.jp:443) mod_md support is unavailable.
[Thu Dec 27 18:47:48.980142 2018] [ssl:debug] [pid 9530] ssl_engine_init.c(492): AH01893: Configuring TLS extension handling
[Thu Dec 27 18:47:48.980295 2018] [ssl:debug] [pid 9530] ssl_util_ssl.c(470): AH02412: [mydomain.jp:443] Cert matches for name 'mydomain.jp' [subject: CN=mydomain.jp / issuer: CN=Let's Encrypt Authority X3,O=Let's Encrypt,C=US / serial: 030B---------------------------0BBC9 / notbefore: Nov 23 13:42:28 2018 GMT / notafter: Feb 21 13:42:28 2019 GMT]
[Thu Dec 27 18:47:48.980301 2018] [ssl:info] [pid 9530] AH02568: Certificate and private key mydomain.jp:443:0 configured from /................./cert.pem and /...................../privkey.pem



-------------------------------------
vpn.error.log
-------------------------------------
[Thu Dec 27 18:47:48.981977 2018] [proxy:debug] [pid 9531] proxy_util.c(1785): AH00925: initializing worker https://192.168.1.2/ shared
[Thu Dec 27 18:47:48.981996 2018] [proxy:debug] [pid 9531] proxy_util.c(1827): AH00927: initializing worker https://192.168.1.2/ local
[Thu Dec 27 18:47:48.982011 2018] [proxy:debug] [pid 9531] proxy_util.c(1878): AH00931: initialized single connection worker in child 9531 for (192.168.1.2)
[Thu Dec 27 18:47:48.982204 2018] [proxy:debug] [pid 9532] proxy_util.c(1785): AH00925: initializing worker https://192.168.1.2/ shared
[Thu Dec 27 18:47:48.982210 2018] [proxy:debug] [pid 9532] proxy_util.c(1827): AH00927: initializing worker https://192.168.1.2/ local
[Thu Dec 27 18:47:48.982222 2018] [proxy:debug] [pid 9532] proxy_util.c(1878): AH00931: initialized single connection worker in child 9532 for (192.168.1.2)
[Thu Dec 27 18:47:48.982631 2018] [proxy:debug] [pid 9533] proxy_util.c(1785): AH00925: initializing worker https://192.168.1.2/ shared
[Thu Dec 27 18:47:48.982636 2018] [proxy:debug] [pid 9533] proxy_util.c(1827): AH00927: initializing worker https://192.168.1.2/ local
[Thu Dec 27 18:47:48.982649 2018] [proxy:debug] [pid 9533] proxy_util.c(1878): AH00931: initialized single connection worker in child 9533 for (192.168.1.2)
[Thu Dec 27 18:47:48.983229 2018] [proxy:debug] [pid 9534] proxy_util.c(1785): AH00925: initializing worker https://192.168.1.2/ shared
[Thu Dec 27 18:47:48.983238 2018] [proxy:debug] [pid 9534] proxy_util.c(1827): AH00927: initializing worker https://192.168.1.2/ local
[Thu Dec 27 18:47:48.983258 2018] [proxy:debug] [pid 9534] proxy_util.c(1878): AH00931: initialized single connection worker in child 9534 for (192.168.1.2)
[Thu Dec 27 18:47:48.983913 2018] [proxy:debug] [pid 9535] proxy_util.c(1785): AH00925: initializing worker https://192.168.1.2/ shared
[Thu Dec 27 18:47:48.983922 2018] [proxy:debug] [pid 9535] proxy_util.c(1827): AH00927: initializing worker https://192.168.1.2/ local
[Thu Dec 27 18:47:48.983943 2018] [proxy:debug] [pid 9535] proxy_util.c(1878): AH00931: initialized single connection worker in child 9535 for (192.168.1.2)

ここまでがApache起動直後の状態です.
ここで,施設①(接続できないほう)から接続を試みると次のようなログが増えます(増分のみ記載)

virtual.host.access.log
133.91.40.56 - - [27/Dec/2018:18:53:52 +0900] "POST /vpnsvc/connect.cgi HTTP/1.1" 421 1878 "-" "-"

-------------------------------------
virtual.host.error.log
-------------------------------------
[Thu Dec 27 18:53:52.494765 2018] [ssl:info] [pid 9531] [client 133.91.40.56:10106] AH01964: Connection to child 0 established (server edove.mydns.jp:443)
[Thu Dec 27 18:53:52.495226 2018] [ssl:debug] [pid 9531] ssl_engine_kernel.c(2139): [client 133.91.40.56:10106] AH02043: SSL virtual host for servername vpn.edove.mydns.jp found
[Thu Dec 27 18:53:52.507287 2018] [ssl:debug] [pid 9531] ssl_engine_kernel.c(2067): [client 133.91.40.56:10106] AH02041: Protocol: TLSv1.2, Cipher: ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
[Thu Dec 27 18:53:52.514157 2018] [ssl:error] [pid 9531] AH02032: Hostname vpn.edove.mydns.jp provided via SNI and hostname 133.91.8.130 provided via HTTP have no compatible SSL setup

-------------------------------------
vpn.error.log
-------------------------------------
[Thu Dec 27 18:53:52.507227 2018] [socache_shmcb:debug] [pid 9531] mod_socache_shmcb.c(495): AH00831: socache_shmcb_store (0x4b -> subcache 11)
[Thu Dec 27 18:53:52.507260 2018] [socache_shmcb:debug] [pid 9531] mod_socache_shmcb.c(849): AH00847: insert happened at idx=0, data=(0:32)
[Thu Dec 27 18:53:52.507267 2018] [socache_shmcb:debug] [pid 9531] mod_socache_shmcb.c(854): AH00848: finished insert, subcache: idx_pos/idx_used=0/1, data_pos/data_used=0/202
[Thu Dec 27 18:53:52.507273 2018] [socache_shmcb:debug] [pid 9531] mod_socache_shmcb.c(516): AH00834: leaving socache_shmcb_store successfully
[Thu Dec 27 18:53:52.514279 2018] [ssl:debug] [pid 9531] ssl_engine_io.c(1103): [client 133.91.40.56:10106] AH02001: Connection closed to child 0 with standard shutdown (server vpn.mydomain.jp:80)










次に施設②(接続できるほう)からアクセスしたログの増分を示します
※接続しDHCPからIPが落ちてきた後すぐに切断しました.
-------------------------------------
virtual.host.access.log
-------------------------------------
000.00.000.000 - - [27/Dec/2018:18:56:43 +0900] "GET / HTTP/1.1" 421 1878 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0"
000.00.000.000 - - [27/Dec/2018:18:56:45 +0900] "GET / HTTP/1.1" 421 1878 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0"


-----------------------------------------
virtual.host.error.log
-------------------------------------
[Thu Dec 27 18:56:43.767959 2018] [ssl:info] [pid 9532] [client 000.00.000.000:50843] AH01964: Connection to child 1 established (server mydomain.jp:443)
[Thu Dec 27 18:56:43.768427 2018] [ssl:debug] [pid 9532] ssl_engine_kernel.c(2139): [client 000.00.000.000:50843] AH02043: SSL virtual host for servername vpn.mydomain.jp found
[Thu Dec 27 18:56:43.781526 2018] [ssl:debug] [pid 9532] ssl_engine_kernel.c(2067): [client 000.00.000.000:50843] AH02041: Protocol: TLSv1.2, Cipher: ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
[Thu Dec 27 18:56:43.788606 2018] [ssl:error] [pid 9532] AH02032: Hostname vpn.mydomain.jp provided via SNI and hostname 126.43.234.55 provided via HTTP have no compatible SSL setup
[Thu Dec 27 18:56:45.646206 2018] [ssl:info] [pid 9533] [client 000.00.000.000:50848] AH01964: Connection to child 2 established (server mydomain.jp:443)
[Thu Dec 27 18:56:45.646632 2018] [ssl:debug] [pid 9533] ssl_engine_kernel.c(2139): [client 000.00.000.000:50848] AH02043: SSL virtual host for servername vpn.mydomain.jp found
[Thu Dec 27 18:56:45.660266 2018] [ssl:debug] [pid 9533] ssl_engine_kernel.c(2067): [client 000.00.000.000:50848] AH02041: Protocol: TLSv1.2, Cipher: ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
[Thu Dec 27 18:56:45.667494 2018] [ssl:error] [pid 9533] AH02032: Hostname vpn.mydomain.jp provided via SNI and hostname 126.43.234.55 provided via HTTP have no compatible SSL setup

--------------------------------------------
vpn.error.log
-------------------------------------
[Thu Dec 27 18:56:43.781480 2018] [socache_shmcb:debug] [pid 9532] mod_socache_shmcb.c(495): AH00831: socache_shmcb_store (0x35 -> subcache 21)
[Thu Dec 27 18:56:43.781502 2018] [socache_shmcb:debug] [pid 9532] mod_socache_shmcb.c(849): AH00847: insert happened at idx=0, data=(0:32)
[Thu Dec 27 18:56:43.781508 2018] [socache_shmcb:debug] [pid 9532] mod_socache_shmcb.c(854): AH00848: finished insert, subcache: idx_pos/idx_used=0/1, data_pos/data_used=0/202
[Thu Dec 27 18:56:43.781513 2018] [socache_shmcb:debug] [pid 9532] mod_socache_shmcb.c(516): AH00834: leaving socache_shmcb_store successfully
[Thu Dec 27 18:56:43.788723 2018] [ssl:debug] [pid 9532] ssl_engine_io.c(1103): [client 000.00.000.000:50843] AH02001: Connection closed to child 1 with standard shutdown (server vpn.mydomain.jp:80)
[Thu Dec 27 18:56:45.660205 2018] [socache_shmcb:debug] [pid 9533] mod_socache_shmcb.c(495): AH00831: socache_shmcb_store (0x20 -> subcache 0)
[Thu Dec 27 18:56:45.660226 2018] [socache_shmcb:debug] [pid 9533] mod_socache_shmcb.c(849): AH00847: insert happened at idx=0, data=(0:32)
[Thu Dec 27 18:56:45.660233 2018] [socache_shmcb:debug] [pid 9533] mod_socache_shmcb.c(854): AH00848: finished insert, subcache: idx_pos/idx_used=0/1, data_pos/data_used=0/202
[Thu Dec 27 18:56:45.660251 2018] [socache_shmcb:debug] [pid 9533] mod_socache_shmcb.c(516): AH00834: leaving socache_shmcb_store successfully
[Thu Dec 27 18:56:45.667603 2018] [ssl:debug] [pid 9533] ssl_engine_io.c(1103): [client 000.00.000.000:50848] AH02001: Connection closed to child 2 with standard shutdown (server vpn.mydomain.jp:80)

以上です.

Re: プロキシ環境下+Apacheリバースプロキシでサーバへ接続できない

Posted: Thu Dec 27, 2018 10:05 am
by cedar
Apacheのリバースプロクシ動作には詳しくないのですが、SSLを解いてしまうとクライアントに正しいサーバー証明書を提示できなくなるような気がします。
(クライアントで検証しない設定になっているか、Apacheのサーバー証明書を検証すれば良いのかもしれませんが。)

証明書関連の問題でないとすると、クライアント側のプロクシとの相性問題のほうがありそうですね。
通信の方向が頻繁に切り替わることが問題だとすると、半二重モードに設定すると良いかもしれません。

Re: プロキシ環境下+Apacheリバースプロキシでサーバへ接続できない

Posted: Thu Dec 27, 2018 1:46 pm
by kazuki
返信ありがとうございます.

半二重モードに設定してみましたが.SSLの明示にかかわらず全滅でした…

試せることがあればいろいろ試してみたいのですが,ほかに何か思いつくことはありますでしょうか

よろしくお願いします

Re: プロキシ環境下+Apacheリバースプロキシでサーバへ接続できない

Posted: Thu Dec 27, 2018 4:41 pm
by cedar
Apacheは関係なくて、クライアント側のプロクシが SoftEther VPN と相性問題があるという可能性も考えられます。
通常の VPN サーバーには接続できるでしょうか?

Re: プロキシ環境下+Apacheリバースプロキシでサーバへ接続できない

Posted: Fri Dec 28, 2018 8:19 am
by kazuki
通常、というのがわかりませんが、
リバースプロキシを通さずに、192.168.1.2のSoftetherVPNサーバへ直接接続するとなんの問題もなくVPNがはれます。
(つまりルータのポート転送で192.168.1.2に443番を流すように設定)

今までその方法でやっていたのですが、httpsサーバを他にも設置したためバーチャルホストが必要になり、リバースプロキシを導入した次第です。

また、しばらく前に試したことを思い出したのですが、施設のプロキシを通した場合、
・Win上にSoftethVPNサバを設置した場合はうまく動きましたが、
・Ubuntu上に設置した場合は接続できませんでした

テザリングであれば↑のどちらも正しく使えました。

もしかしてこれは、Ubuntuと施設のプロキシの相性が悪いのでしょうか…

Re: プロキシ環境下+Apacheリバースプロキシでサーバへ接続できない

Posted: Fri Dec 28, 2018 8:54 am
by cedar
Ubuntuとの相性が悪いというのは考えにくいですが、問題の起きているプロクシは、何か通信内容またはタイミングに干渉するような動作となっている可能性は考えられると思います。
443は他の用途で使用したいとして、5555など他のポートを使用する訳にはいかないでしょうか。

Re: プロキシ環境下+Apacheリバースプロキシでサーバへ接続できない

Posted: Fri Dec 28, 2018 4:52 pm
by kazuki
可能であればそうしたいところなのですが,
どうやら一部のWell-knownポートしか通信を許可していないようなのです...

80,443は通過できることを確認していますが,たとえば8000番などはダメでした
ポート番号だけを見ているのか,プロトコルも見ているのかはわかっていませんが,かなり制限の厳しいプロキシと思います

これはもうあきらめるしかなさそうでしょうか…

Re: プロキシ環境下+Apacheリバースプロキシでサーバへ接続できない

Posted: Fri Dec 28, 2018 9:18 pm
by cedar
性能は落ちますが、VPN over DNS や VPN Azure サービスを使用するのはいかがでしょうか。

Re: プロキシ環境下+Apacheリバースプロキシでサーバへ接続できない

Posted: Tue Jan 08, 2019 4:31 pm
by kazuki
お返事が遅くなり申し訳ありません.
試してみたところ,DNSは施設に指定された施設のDNSサーバ以外使用できないようでした.

またAzureについては今回はちょっと使えないかなと思っております.

仕方がないので,リバースプロキシを外し,443番をダイレクトにSoftetherVPNサーバに流すように設定を戻しました...
また何か思いついたら試してみます.

Re: プロキシ環境下+Apacheリバースプロキシでサーバへ接続できない

Posted: Sun Jan 13, 2019 4:49 pm
by taylordad
kazuki wrote:
Tue Jan 08, 2019 4:31 pm
お返事が遅くなり申し訳ありません.
試してみたところ,DNSは施設に指定された施設のDNSサーバ以外使用できないようでした.

またAzureについては今回はちょっと使えないかなと思っております.

仕方がないので,リバースプロキシを外し,443番をダイレクトにSoftetherVPNサーバに流すように設定を戻しました...
また何か思いついたら試してみます.
可能であればそうしたいところなのですが,
どうやら一部のWell-knownポートしか通信を許可していないようなのです...

80,443は通過できることを確認していますが,たとえば8000番などはダメでした
ポート番号だけを見ているのか,プロトコルも見ているのかはわかっていませんが,かなり制限の厳しいプロキシと思います

これはもうあきらめるしかなさそうでしょうか