Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
18590 มุมมอง

I have always managed to use Odoo's API with this but now I have a new Ubuntu server and whenever I try to login, I get:

ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)

Login process:

server = ServerProxy(SERVER+'/xmlrpc/common')
uid = server.login(db, user_id, password)
server = ServerProxy(SERVER+'/xmlrpc/object')

Any ideas how to fix this?



อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

When I added 

server = ServerProxy(SERVER+'/xmlrpc/common',verbose=False, use_datetime=True,context=ssl._create_unverified_context())
uid = server.login(db, user_id, password)
server = ServerProxy(SERVER+'/xmlrpc/object',verbose=False, use_datetime=True,context=ssl._create_unverified_context())

Everything works. Got it from http://stackoverflow.com/questions/30461969/disable-default-certificate-verification-in-python-2-7-9

อวตาร
ละทิ้ง

You also need to import the package 'ssl' in the top of your Python script or this will complain about ssl not being found.

Thank you so much

คำตอบที่ดีที่สุด

Id like to open this again if possible, I tried this exact method on my V17 install, fresh odoo.sh implementation. the only way im able to access the instance is via http:// which seems odd.

my odoo site reports a valid ssl cert.

any thoughts on this anyone?

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ก.พ. 22
5494
api.onchange v8 doesnt work แก้ไขแล้ว
2
ก.ย. 15
4568
0
พ.ค. 15
3088
2
ม.ค. 19
4091
0
ม.ค. 18
4692