Skip to content
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

setting https for the connector #288

Open
l-arnold opened this issue Feb 3, 2019 · 2 comments
Open

setting https for the connector #288

l-arnold opened this issue Feb 3, 2019 · 2 comments

Comments

@l-arnold
Copy link

l-arnold commented Feb 3, 2019

(Edit: On Magento Connector Branch 8.0 in Debian and connecting with Magento 1.93)
When specifying https rather than http in the connector I am getting the following error:

A network error caused the failure of the job: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)

I have tried to put .crt/.pem files from the Magento Site into the Odoo Server in openssl findable directories but I still get the failure. Somehow in fact my attempts ended up causing problems with XMLRPC protocol so I have, for now, gone to a backup which is working again.

It seems that there are several references to Code like the following that can stop "verification" though I am not finding any way to control this behavior in Magento Connector. Perhaps some sort of a Python statement could implement it..

Example from https://stackoverflow.com/questions/19268548/python-ignore-certificate-validation-urllib2

import urllib2, ssl

request = urllib2.Request('https://somedomain.co/')
response = urllib2.urlopen(request, context=ssl._create_unverified_context())

I really need to get this working. Likely a way with the xmlrpc to get the cert (which is working normally on Magento) to work via putting .pem file into the Odoo system (Debian). That said, I tried that so far with no luck.

Any help here would be appreciated. Seems it would be something to build into the system as it appears to be a common issue in other parts of the Python world and some parts of the Odoo world.

@l-arnold
Copy link
Author

l-arnold commented Feb 3, 2019

So I was able to get http working again (without backup image). A space had entered in at the end of the Connector backend URL entry.

Not successful yet on https though.

@guewen guewen transferred this issue from OCA/connector Feb 4, 2019
@l-arnold
Copy link
Author

l-arnold commented Apr 3, 2019

In Branch 8:

I am back trying to work through this. If I am running Magento in https (for secure and unsecure), then in Odoo MagentoConnector, I have "http://magentourl..."
defined I get :

ProtocolError: <ProtocolError for magentourl/index.php/api/xmlrpc: 500 Internal Server Error>

If I move the connector URL to "https://magentourl..."
I get

A
network error caused the failure of the job: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
--

I have found:
import urllib2

within magentoerpconnect/product.py
testing but not really getting traction by adding

import ssl

directly below. Then lower in the file:
I have tried to add
(after) > request = urllib2.Request(url)
(this line) response = urllib2.urlopen(request, context=ssl._create_unverified_context())

Not getting it done. I will work on this some more. Seems there should be a solution.

(I should generally get more formal here via Git pulls and modifications - I do have this pulled). Need to get back into practice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant