forked from loafle/openapi-generator-original
Allow customizing SSL CA certificate
by adding a `ssl_ca_cert` configuration option
This commit is contained in:
parent
46869df631
commit
19ee56592e
@ -7,6 +7,14 @@ module {{moduleName}}
|
||||
:scheme, :host, :base_path, :user_agent, :debug, :logger, :inject_format,
|
||||
:force_ending_format, :camelize_params, :user_agent, :verify_ssl
|
||||
|
||||
# Set this to customize the certificate file to verify the peer.
|
||||
#
|
||||
# @return [String] the path to the certificate file
|
||||
#
|
||||
# @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
|
||||
# https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
|
||||
attr_accessor :ssl_ca_cert
|
||||
|
||||
# Defaults go in here..
|
||||
def initialize
|
||||
@format = 'json'
|
||||
|
@ -166,6 +166,7 @@ module {{moduleName}}
|
||||
def make
|
||||
request_options = {
|
||||
:ssl_verifypeer => Swagger.configuration.verify_ssl,
|
||||
:cainfo => Swagger.configuration.ssl_ca_cert,
|
||||
:headers => self.headers.stringify_keys,
|
||||
:verbose => Swagger.configuration.debug
|
||||
}
|
||||
|
@ -7,6 +7,14 @@ module SwaggerClient
|
||||
:scheme, :host, :base_path, :user_agent, :debug, :logger, :inject_format,
|
||||
:force_ending_format, :camelize_params, :user_agent, :verify_ssl
|
||||
|
||||
# Set this to customize the certificate file to verify the peer.
|
||||
#
|
||||
# @return [String] the path to the certificate file
|
||||
#
|
||||
# @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
|
||||
# https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
|
||||
attr_accessor :ssl_ca_cert
|
||||
|
||||
# Defaults go in here..
|
||||
def initialize
|
||||
@format = 'json'
|
||||
|
@ -165,6 +165,7 @@ module SwaggerClient
|
||||
def make
|
||||
request_options = {
|
||||
:ssl_verifypeer => Swagger.configuration.verify_ssl,
|
||||
:cainfo => Swagger.configuration.ssl_ca_cert,
|
||||
:headers => self.headers.stringify_keys,
|
||||
:verbose => Swagger.configuration.debug
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user