* [ruby-dev:50165] [Ruby trunk Feature#13729] PATCH: Add Server Name Indication (SNI) support to WEBrick
[not found] <redmine.issue-13729.20170707094908@ruby-lang.org>
@ 2017-07-07 9:49 ` tietew
2017-07-14 5:44 ` [ruby-dev:50173] " tietew
2017-07-18 0:00 ` [ruby-dev:50178] [Ruby trunk Feature#13729][Assigned] " hsbt
2 siblings, 0 replies; 3+ messages in thread
From: tietew @ 2017-07-07 9:49 UTC (permalink / raw
To: ruby-dev
Issue #13729 has been reported by Tietew (Toru Iwase).
----------------------------------------
Feature #13729: PATCH: Add Server Name Indication (SNI) support to WEBrick
https://bugs.ruby-lang.org/issues/13729
* Author: Tietew (Toru Iwase)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
WEBrick に Server Name Indication (SNI) サポートを追加するパッチです。
よくWEBrickで簡易サーバを立てているのですが、SNIでバーチャルホストを立てたかった(けどできなかった)のでパッチを書きました。
`WEBrick::HTTPServer` が元々持っているバーチャルホストの仕組みに乗っかっています。
一応テストも入っています。
Google Chrome + Let's Encryptの証明書(SANではない単一CNの証明書複数)でちゃんと接続できることも確認しました。
usage:
~~~ ruby
# master (default) server
master = WEBrick::HTTPSerevr.new({
:ServerName => "master.example.com",
:Port => 443,
:SSLEnable => true,
:SSLCertificate => "CN=master.example.com の証明書",
:SSLPrivateKey => "秘密鍵",
})
master.mount_proc("/") { |req, res| res.body = "default host!\n" }
# virtual host
vhost = WEBrick::HTTPServer.new({
:ServerName => "vhost.example.jp", # SNIバーチャルホスト名
:Port => 443, # master serverと同じポート番号を指定
:DoNotListen => true, # true必須
:SSLEnable => true, # true必須
:SSLCertificate => "CN=vhost.example.jp の証明書",
:SSLPrivateKey => "秘密鍵",
})
vhost.mount_proc("/") { |req, res| res.body = "virtual host!\n" }
master.virtual_host(vhost)
master.start
~~~
---Files--------------------------------
webrick_sni_support.patch (5.16 KB)
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* [ruby-dev:50173] [Ruby trunk Feature#13729] PATCH: Add Server Name Indication (SNI) support to WEBrick
[not found] <redmine.issue-13729.20170707094908@ruby-lang.org>
2017-07-07 9:49 ` [ruby-dev:50165] [Ruby trunk Feature#13729] PATCH: Add Server Name Indication (SNI) support to WEBrick tietew
@ 2017-07-14 5:44 ` tietew
2017-07-18 0:00 ` [ruby-dev:50178] [Ruby trunk Feature#13729][Assigned] " hsbt
2 siblings, 0 replies; 3+ messages in thread
From: tietew @ 2017-07-14 5:44 UTC (permalink / raw
To: ruby-dev
Issue #13729 has been updated by Tietew (Toru Iwase).
File webrick_sni_support_fix.patch added
ごめんなさい。前回送ったパッチですが、不完全でした。正しくContextを返していませんでした。
テスト時に大ぽかしてSAN証明書を参照していたため、見誤っていました。
そこの修正と、正しい証明書が提示されたことを確認するテストを追加したパッチを追加します。
----------------------------------------
Feature #13729: PATCH: Add Server Name Indication (SNI) support to WEBrick
https://bugs.ruby-lang.org/issues/13729#change-65771
* Author: Tietew (Toru Iwase)
* Status: Closed
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
WEBrick に Server Name Indication (SNI) サポートを追加するパッチです。
よくWEBrickで簡易サーバを立てているのですが、SNIでバーチャルホストを立てたかった(けどできなかった)のでパッチを書きました。
`WEBrick::HTTPServer` が元々持っているバーチャルホストの仕組みに乗っかっています。
一応テストも入っています。
Google Chrome + Let's Encryptの証明書(SANではない単一CNの証明書複数)でちゃんと接続できることも確認しました。
usage:
~~~ ruby
# master (default) server
master = WEBrick::HTTPSerevr.new({
:ServerName => "master.example.com",
:Port => 443,
:SSLEnable => true,
:SSLCertificate => "CN=master.example.com の証明書",
:SSLPrivateKey => "秘密鍵",
})
master.mount_proc("/") { |req, res| res.body = "default host!\n" }
# virtual host
vhost = WEBrick::HTTPServer.new({
:ServerName => "vhost.example.jp", # SNIバーチャルホスト名
:Port => 443, # master serverと同じポート番号を指定
:DoNotListen => true, # true必須
:SSLEnable => true, # true必須
:SSLCertificate => "CN=vhost.example.jp の証明書",
:SSLPrivateKey => "秘密鍵",
})
vhost.mount_proc("/") { |req, res| res.body = "virtual host!\n" }
master.virtual_host(vhost)
master.start
~~~
---Files--------------------------------
webrick_sni_support.patch (5.16 KB)
webrick_sni_support_fix.patch (6.12 KB)
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* [ruby-dev:50178] [Ruby trunk Feature#13729][Assigned] PATCH: Add Server Name Indication (SNI) support to WEBrick
[not found] <redmine.issue-13729.20170707094908@ruby-lang.org>
2017-07-07 9:49 ` [ruby-dev:50165] [Ruby trunk Feature#13729] PATCH: Add Server Name Indication (SNI) support to WEBrick tietew
2017-07-14 5:44 ` [ruby-dev:50173] " tietew
@ 2017-07-18 0:00 ` hsbt
2 siblings, 0 replies; 3+ messages in thread
From: hsbt @ 2017-07-18 0:00 UTC (permalink / raw
To: ruby-dev
Issue #13729 has been updated by hsbt (Hiroshi SHIBATA).
Status changed from Closed to Assigned
Assignee set to normalperson (Eric Wong)
----------------------------------------
Feature #13729: PATCH: Add Server Name Indication (SNI) support to WEBrick
https://bugs.ruby-lang.org/issues/13729#change-65821
* Author: Tietew (Toru Iwase)
* Status: Assigned
* Priority: Normal
* Assignee: normalperson (Eric Wong)
* Target version:
----------------------------------------
WEBrick に Server Name Indication (SNI) サポートを追加するパッチです。
よくWEBrickで簡易サーバを立てているのですが、SNIでバーチャルホストを立てたかった(けどできなかった)のでパッチを書きました。
`WEBrick::HTTPServer` が元々持っているバーチャルホストの仕組みに乗っかっています。
一応テストも入っています。
Google Chrome + Let's Encryptの証明書(SANではない単一CNの証明書複数)でちゃんと接続できることも確認しました。
usage:
~~~ ruby
# master (default) server
master = WEBrick::HTTPSerevr.new({
:ServerName => "master.example.com",
:Port => 443,
:SSLEnable => true,
:SSLCertificate => "CN=master.example.com の証明書",
:SSLPrivateKey => "秘密鍵",
})
master.mount_proc("/") { |req, res| res.body = "default host!\n" }
# virtual host
vhost = WEBrick::HTTPServer.new({
:ServerName => "vhost.example.jp", # SNIバーチャルホスト名
:Port => 443, # master serverと同じポート番号を指定
:DoNotListen => true, # true必須
:SSLEnable => true, # true必須
:SSLCertificate => "CN=vhost.example.jp の証明書",
:SSLPrivateKey => "秘密鍵",
})
vhost.mount_proc("/") { |req, res| res.body = "virtual host!\n" }
master.virtual_host(vhost)
master.start
~~~
---Files--------------------------------
webrick_sni_support.patch (5.16 KB)
webrick_sni_support_fix.patch (6.12 KB)
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-07-18 0:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <redmine.issue-13729.20170707094908@ruby-lang.org>
2017-07-07 9:49 ` [ruby-dev:50165] [Ruby trunk Feature#13729] PATCH: Add Server Name Indication (SNI) support to WEBrick tietew
2017-07-14 5:44 ` [ruby-dev:50173] " tietew
2017-07-18 0:00 ` [ruby-dev:50178] [Ruby trunk Feature#13729][Assigned] " hsbt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).