cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

I am in a process of Connecting to X vendor and pull back the data needed from that X vendor.

Sree_Patllola
New Contributor

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)

0 REPLIES 0

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group