Last active
December 18, 2023 20:06
-
-
Save vitaliel/196d3bda81d5831a35a91fa678d50d48 to your computer and use it in GitHub Desktop.
SearchFlip: Opensearch, skip ssl verification
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
# Skip ssl verification for local opensearch service | |
class CustomerIndex | |
include SearchFlip::Index | |
# Tested on OpenSearch 1.3 and 2.5 | |
def self.connection | |
ctx = OpenSSL::SSL::SSLContext.new | |
ctx.verify_mode = OpenSSL::SSL::VERIFY_NONE | |
http_client = SearchFlip::HTTPClient.new(plugins: [ | |
proc {|res, method, uri, opts| opts[:ssl_context] = ctx; res } | |
]).basic_auth(user: "admin", pass: "admin") | |
mimic_es SearchFlip::Connection.new http_client: http_client | |
end | |
def self.mimic_es connection | |
connection.instance_variable_set :@version, '8.1.1' | |
connection | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment