콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
9257 화면

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.

아바타
취소
베스트 답변

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

아바타
취소
관련 게시물 답글 화면 활동
7
1월 24
49727
2
10월 20
3831
0
2월 21
3554
0
4월 17
3110
0
7월 21
3741