Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

動的証明書読み込み ngx_mruby編 #hoscon / GMO HosCon 2016

動的証明書読み込み ngx_mruby編 #hoscon / GMO HosCon 2016

"HosCon - GMO Hosting Conference - @渋谷" http://gmohoscon.connpass.com/event/41490/ の発表スライドです。10分 LT なのにだいぶ詰め込んでます。

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

【資料に登場したURLs】
SSL_CTX_set_cert_cb() の説明:
https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_cert_cb.html

ngx_mruby で動的証明書読み込みをサポートした旨のツイート:
https://twitter.com/matsumotory/status/685341115814289408

ngx_mruby に mruby_ssl_handshake_handler を実装した:
http://blog.hifumi.info/2016/10/03/ngx_mruby-mruby_ssl_handshake_handler/

mruby のテスト用に MySQL 環境を自動で構築する mruby-test-mysqld を書いた
:
http://blog.hifumi.info/2016/09/06/mruby-test-mysqld/

How to test code with mruby:
http://www.slideshare.net/hsbt/20150525-testing-casualtalks

Okumura Takahiro

October 29, 2016
Tweet

More Decks by Okumura Takahiro

Other Decks in Technology

Transcript

  1. NSVCZ@TTM@IBOETIBLF@IBOEMFS@DPEFͷ՝୊ mruby_ssl_handshake_handler_code ' ssl = Nginx::SSL.new ssl.certificate = "/path/to/#{ssl.servername}.crt" ssl.certificate_key

    = "/path/to/#{ssl.servername}.key" ’; JOMJOFܗࣜͷσΟϨΫςΟϒ͸ίʔυ͕௕͘ͳΔͱಡΈͮΒ ͍͕ɺϑΝΠϧ͔ΒಡΈࠐΉσΟϨΫςΟϒ͸౰࣌ແ͔ͬͨɻ
  2. NSVCZ@TTM@IBOETIBLF@IBOEMFS mruby_ssl_handshake_handler /path/to/handler.rb cache; # /path/to/handler.rb ssl = Nginx::SSL.new ssl.certificate

    = "/path/to/#{ssl.servername}.crt" ssl.certificate_key = "/path/to/#{ssl.servername}.key" NSVCZ@TTM@IBOETIBLF@IBOEMFS@DPEFͱಉ͡ػೳͰɺ
 QBUIUPIBOEMFSSCͷΑ͏ͳ֎෦ϑΝΠϧΛಡΈࠐΊΔ
  3. ಈతূ໌ॻಡΈࠐΈͷͨΊͷΠϯϑϥ MC SFWFSTFQSPYZ OHY@NSVCZ BQQMJDBUJPO DBDIF SFEJT EC NZTRM 5-44/*֦ுͰTFSWFS@OBNFΛड͚औΔ

    ূ໌ॻͱ伴 Bແ͚Ε͹EC͔Βऔಘ CΩϟογϡ ͍͍ͩͨ͜Μͳ งғؾʹͳΔ ϓϩΩγ
  4. ಈతূ໌ॻಡΈࠐΈͷͨΊͷΠϯϑϥ MC SFWFSTFQSPYZ OHY@NSVCZ BQQMJDBUJPO DBDIF SFEJT EC NZTRM 5-44/*֦ுͰTFSWFS@OBNFΛड͚औΔ

    ূ໌ॻͱ伴 Bແ͚Ε͹EC͔Βऔಘ CΩϟογϡ ͍͍ͩͨ͜Μͳ งғؾʹͳΔ ϓϩΩγ ςετ΄͍͠