For that we have shared our Azure IP addres (NO VPN or Corporate IP address Available as of now - still initial stages of the project) with X vendor, which is whitelisted now.
Now I am trying to setup the X vendor API in the databricks to lookup into the APi and fetch the response.
I have the url, credentials, .jks file, .pem file, certificate password.
with my below approach i am getting the error "[SSL] PEM lib (_ssl.c:4046)"
Can someone help me if my approach is missing something..
import http.client
import json
import ssl
# Defining certificate related stuff and host of endpoint
certificate_file = "/dbfs/mnt/blob/Bronze/abc.112.2022.04.pem"
certificate_secret= "secretkey"
host = ' https://efgh0112-dev.abc-connect.com';
user = "abc.id.efgh0112-dev.2022.04"
passwd = "password"
# Defining parts of the HTTP request
request_url='/link-ws/abc/postIdentity'
request_headers = {
'Content-Type': 'application/json'
}
# Define the client certificate settings for https connection
context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
context.load_cert_chain(certfile=certificate_file, password=certificate_secret)
# Create a connection to submit HTTP requests
connection = http.client.HTTPSConnection(host, port=443, context=context)
# Use connection to submit a HTTP POST request
connection.request(method="POST", url=request_url, headers=request_headers, body=json.dumps(request_body_dict))
# Print the HTTP response from the IOT service endpoint
response = connection.getresponse()
print(response.status, response.reason)
data = response.read()
print(data)