Last active
April 17, 2024 16:44
-
-
Save stringsn88keys/fb80ad398406fabaeb040b7eb6eef0b1 to your computer and use it in GitHub Desktop.
OpenSSL ruby constants and settings dump
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'openssl' | |
# https://ruby.github.io/openssl/OpenSSL.html | |
puts "OpenSSL::OPENSSL_FIPS = #{OpenSSL::OPENSSL_FIPS}" | |
puts "\t-> Boolean indicating whether OpenSSL is FIPS-capable or not" | |
# try to turn on fips_mode if it is marked as true | |
if OpenSSL::OPENSSL_FIPS | |
puts "-> Setting fips_mode to true" | |
begin | |
OpenSSL.fips_mode = true | |
puts "-> fips_mode successfully turned on" | |
rescue OpenSSL::OpenSSLError => e | |
puts "X-> turning on fips_mode failed with \"#{e.message}\"" | |
end | |
end | |
puts | |
puts "OpenSSL::OPENSSL_LIBRARY_VERSION = #{OpenSSL::OPENSSL_LIBRARY_VERSION}" | |
puts "OpenSSL::OPENSSL_VERSION = #{OpenSSL::OPENSSL_VERSION}" | |
puts "-> Version of OpenSSL the ruby OpenSSL extension was built with" | |
puts | |
puts "OpenSSL::OPENSSL_VERSION_NUMBER = #{OpenSSL::OPENSSL_VERSION_NUMBER.to_s(16)}" | |
puts "-> Version number of OpenSSL the ruby OpenSSL extension was built with (base 16)." | |
puts | |
puts " The formats are below." | |
puts " ----------------------" | |
puts " OpenSSL 3" | |
puts " ->0xMNN00PP0 (major minor 00 patch 0)" | |
puts " OpenSSL before 3" | |
puts " ->0xMNNFFPPS (major minor fix patch status)" | |
puts " LibreSSL" | |
puts " -> 0x20000000 (fixed value)" | |
puts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment