# dbt-core Python model issue - SSL certificates

**URL:** <https://discourse.getdbt.com/t/dbt-core-python-model-issue-ssl-certificates/7666>\
**Category:** Help\
**Created:** [April 4, 2023, 4:51pm UTC](https://discourse.getdbt.com/t/dbt-core-python-model-issue-ssl-certificates/7666 "2023-04-04T16:51:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremym9](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@jeremym9](https://discourse.getdbt.com/u/jeremym9)\
**Post date:** [April 4, 2023, 4:51pm UTC](https://discourse.getdbt.com/t/dbt-core-python-model-issue-ssl-certificates/7666/1 "2023-04-04T16:51:31Z")

</div>

## The problem I’m having

I’m unable to use Python models with dbt-core. I run into a a SSL certificate verify failure when communicating with my Databricks instance. SQL models work fine.

## What I’ve already tried

- Creating simple Python models (doesn’t work)
- Creating SQL models (does work)
- Disabling ssl\_verify on my conda configuration file

## Some example code or error messages

HTTPSConnectionPool(host=‘\<databricks\_domain\>’, port=443): Max retries exceeded with url: /api/1.2/contexts/create (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE\_VERIFY\_FAILED] certificate verify failed: self signed certificate in certificate chain (\_ssl.c:1129)’)))

---

<div class="post-metadata">

**Author:** ![joellabes](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/joellabes/32/3980_2.png) [@joellabes](https://discourse.getdbt.com/u/joellabes)\
**Post date:** [April 4, 2023, 11:52pm UTC](https://discourse.getdbt.com/t/dbt-core-python-model-issue-ssl-certificates/7666/2 "2023-04-04T23:52:39Z")

</div>

This is interesting @jeremym9! I don’t think `dbt debug` has been updated to validate Python connectivity, but maybe it needs to…

Does this article from the databricks site help? [How to import a custom CA certificate - Databricks](https://kb.databricks.com/python/import-custom-ca-cert.html)

---

<div class="post-metadata">

**Author:** ![jeremym9](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@jeremym9](https://discourse.getdbt.com/u/jeremym9)\
**Post date:** [April 5, 2023, 4:04pm UTC](https://discourse.getdbt.com/t/dbt-core-python-model-issue-ssl-certificates/7666/3 "2023-04-05T16:04:20Z")

</div>

So I had to import CA certificates onto my machine, then reference them in my pip.ini file - this allowed me to install python-certifi-win32 which removed the SSL error from my python models.

While this isn’t necessarily a dbt issue, it is interesting that SQL models do not encounter this issue (maybe they are using a different API?) I do think dbt debug needs to be updated to reflect this kind of issue.

---

<div class="post-metadata">

**Author:** ![joellabes](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/joellabes/32/3980_2.png) [@joellabes](https://discourse.getdbt.com/u/joellabes)\
**Post date:** [April 5, 2023, 4:33pm UTC](https://discourse.getdbt.com/t/dbt-core-python-model-issue-ssl-certificates/7666/4 "2023-04-05T16:33:21Z")

</div>

Glad you worked it out! I’ve created [SSL certificate verification errors when trying to run Python models · Issue #305 · databricks/dbt-databricks · GitHub](https://github.com/databricks/dbt-databricks/issues/305) on the Databricks repo which will hopefully get an improvement to this.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/getdbt/original/1X/a7a7ca1fe379aaf90952b0e13118a817babcd14f.png) [@system](https://discourse.getdbt.com/u/system)\
**Post date:** [April 12, 2023, 4:34pm UTC](https://discourse.getdbt.com/t/dbt-core-python-model-issue-ssl-certificates/7666/5 "2023-04-12T16:34:04Z")

</div>

Closed on April 12, 2023, 4:34pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
