-
Notifications
You must be signed in to change notification settings - Fork 128
Fixed multiple issues with configuration of Legacy API #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
2 similar comments
Thanks for the PR, can you explain a bit more about your use case? Are you using a self-signed certificate? I do agree the readme needs to be updated, but I am able to hit the api using legacy credentials without any changes. |
ping @kirtithorat |
@pedelman Thank you for your response. I am using a self-signed certificate. I tried two use cases, one connecting Legacy API without SSL enabled and other with SSL enabled. In the first case, Legacy API without SSL, I am expecting to connect to BigCommerce without SSL being verified. Configuration looks like:
I started getting the error In the second case, Legacy API with enabled SSL, I got the error Please let me know if you have any other questions regarding the PR. |
|
|
Im going to close this as we have a good discussion in #96 |
I would like to submit the following changes/ fixes in this pull request. Please review and merge the pull request as soon as possible. If you have any questions and concerns about these changes then let me know by replying on this thread.
Error:
no implicit conversion of OpenSSL::X509::Certificate into String
The
bigcommerce-api-ruby
gem already takes care of creating appropriateOpenSSL::X509::Certificate
andOpenSSL::PKey::RSA
instances for keysssl_client_cert
andssl_client_key
respectively inlib/bigcommerce/connection.rb
. It should not be provided again while configuring Legacy API client as it results in above mentioned error.Fixes:
Updated
README.md
to reflect the correct usage:Also, updated
ssl_client_key=
method inlib/bigcommerce/connection.rb
so that it accepts anoptions
hash withpath
andpassphrase
.Errors:
undefined methods client_cert, ssl_client_key, ssl_ca_file and verify_ssl
Fixes:
In
lib/bigcommerce/connection.rb
, methodsssl_ca_file=
,ssl_client_key=
andssl_client_cert=
try to set attributes on@configuration
which is aHash
. This results in undefined methods error in all the three cases. Also, the key name for client certificate is used asssl_client_cert
throughout the gem code but inlib/bigcommerce/connection.rb
it is used as@configuration.client_cert
, fixed the code to use@connection[:ssl_client_cert]
instead . Modified code to set the correct key-value pair in@configuration
Hash is as below:Also, while configuring Legacy API with SSL, expected method name is
verify_ssl=
. Corrected the method name fromverify_peer=
toverify_ssl=
inlib/bigcommerce/connection.rb
Error:
RestClient
uses:user
as a valid key not:username
Fixes:
Because of this issue the connection was not getting established as
:user
key was not found. Updatedlib/bigcommerce/connection.rb
to set:user
key instead of:username
**Error:**Removed default enabled SSL for Legacy API
Because of this issue, when we try to configure and connect via Legacy API(without SSL fields), we get failure due to SSL.
Fixes:
RestClient
by default enables SSL(when:verify_ssl
key is not supplied), which was causing Legacy API to default to the same with or without SSL specifications in its API configuration. Updatedlib/bigcommerce/connection.rb
so that Legacy API does not default to SSL enabled form.