How to set SSLContext options in Ruby

后端 未结 1 414
难免孤独
难免孤独 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)
提交回复
热议问题