I'm facing an Odoo SSL error. The error is:
raise SSLError(e, request=request)
SSLError: HTTPSConnectionPool(host='12.123.12.12', port=443): Max retries exceeded with url: /api/logistics/filldetailsntf (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727)'),))
I'm writing a controller and I was checking on it. I need to know also how to turn off /Bypass the SSL Certification Verification in this controller. I'm pasting the controller below.
# -*- coding: utf-8 -*-
from odoo import http
import ssl
import requests
import json
from odoo.http import request
import urllib, urllib2
from odoo import report as odoo_report
import datetime
import pytz
import base64
import logging
_logger = logging.getLogger(__name__)
url = 'https://12.123.12.12/api/logistics/filldetailsntf'
authentication = '129487521452XSDFG156235C6B353CD75QWERBVFGHJAA96AA99EDSJUITH7AAF65258F22871E7D415EB4A77CF7B4CB513A993680FC6053EAE6RT785YUIJ124'
class MyApi(http.Controller):
@http.route("/my/post/api/path", url=url, auth="public", type='http', methods=['POST', 'GET'], csrf=False, cors='*',
ssl=False, verify=False)
def post_api_method(self, **kw):
partners = request.env['import.logic'].sudo().search_read([('customer', '=', 'TRADING COMPANY')])
print kw
headers = {'Content-Type': 'application/json'}
body = {'results': {"shipmentType": "partners",
"shipperName": "Name",
"consigneeName": "*****",
"vslexparvlDate": "2019-03-05 05:55:13:000",
"vsldischlDate": "2019-04-02 05:55:13:000",
"docRecvByMailDate": "2019-03-05 05:55:13:000",
"orgDocRecvgDate": "2019-03-24 05:55:13:000",
"vesselArvlDate": "2019-03-19 05:55:13:000",
"bLAwbNumber": "*****",
"houseBL": "****",
"dischargingPort": "*****",
"landingPort": "*****",
"containerNumber": "*****",
"delOrderDate": "2019-03-29 05:55:13:000",
"delOrderNumber": "******",
"bayanNumber": "*****",
"bayanDate": "2019-03-30 05:55:13:000",
"containerType": "*****",
"dutyPaidDate": "2019-03-22 05:55:13:000",
"transportNTFTerminal": "***",
"transportDirCustomer": "***",
"demmurageDate": "2019-03-27 05:55:13:000",
"lastDetentionDate": "2019-03-27 05:55:13:000",
"eIRReturnToShipLine": "****",
"eventUpdateStatus": "Delivered"
}}
response = requests.post(url, json.dumps(body), headers=headers)
return response
This is the code I have written. I need to push the data from my odoo to this API first. While I was testing only I got this error. First I need to solve this ssl error and I need to assign the correct field on each and every key with my field value from inside of the `partner` which is mentioned in the code.
I'm using Odoo.sh, if anybody can please help me.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
1
Trả lời
9085
Lượt xem
it seems targeted API refuse to answer because of too many requests are sent
ref: https://stackoverflow.com/questions/23013220/max-retries-exceeded-with-url-in-requests
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
7
thg 1 24
|
49330 | ||
|
2
thg 10 20
|
3695 | ||
|
0
thg 2 21
|
3386 | ||
|
0
thg 4 17
|
2997 | ||
|
0
thg 7 21
|
3528 |