How to set SSLContext options in Ruby

后端 未结 1 420
难免孤独
难免孤独 2020-12-03 12:47

I need to create an SSLSocket in Ruby 1.8+ to talk to an encrypted service. I want to set SSL options on the SSLContext object (it eventually calls

1条回答
  •  醉梦人生
    2020-12-03 13:17

    Example:

    ctx = OpenSSL::SSL::SSLContext.new
    
    ctx.set_params(:options => OpenSSL::SSL::OP_EPHEMERAL_RSA | OpenSSL::SSL::OP_NO_SSLv2)
    # or
    ctx.options = OpenSSL::SSL::OP_EPHEMERAL_RSA | OpenSSL::SSL::OP_NO_SSLv2
    

    0 讨论(0)
提交回复
热议问题