Skip to content

Commit

Permalink
Add guard in case OpenSSL::SSL::OP_IGNORE_UNEXPECTED_EOF is not defined
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph Palermo <[email protected]>
Co-authored-by: Joseph Palermo <[email protected]>
  • Loading branch information
danielfor and jpalermo committed Feb 20, 2024
1 parent 506a902 commit 1ed6afa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bosh_azure_cpi/lib/cloud/azure/restapi/azure_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2262,7 +2262,7 @@ def redact_credentials_in_response_body(body)
def http(uri, use_ssl = true)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true && use_ssl
http.ssl_options = OpenSSL::SSL::OP_IGNORE_UNEXPECTED_EOF
http.ssl_options = OpenSSL::SSL::OP_IGNORE_UNEXPECTED_EOF if OpenSSL::SSL.const_defined? :OP_IGNORE_UNEXPECTED_EOF # Does not exist if using openssl 1.x
if @azure_config.environment == ENVIRONMENT_AZURESTACK && uri.host.include?(@azure_config.azure_stack.domain)
# The CA cert is only specified for the requests to AzureStack domain. If specified for other domains, the request will fail.
http.ca_file = get_ca_cert_path
Expand Down

0 comments on commit 1ed6afa

Please sign in to comment.