Skip to content

Commit 2e4c2fe

Browse files
Merge pull request #905 from MasoniteFramework/feature/875-1
Add PostgresConnection to support SSL and tls options
2 parents ce25c0a + bd6e473 commit 2e4c2fe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/masoniteorm/connections/PostgresConnection.py

+8
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ def create_connection(self):
8585
password=self.password,
8686
host=self.host,
8787
port=self.port,
88+
sslmode=self.options.get("sslmode"),
89+
sslcert=self.options.get("sslcert"),
90+
sslkey=self.options.get("sslkey"),
91+
sslrootcert=self.options.get("sslrootcert"),
8892
options=(
8993
f"-c search_path={self.schema or self.full_details.get('schema')}"
9094
if self.schema or self.full_details.get("schema")
@@ -106,6 +110,10 @@ def create_connection(self):
106110
password=self.password,
107111
host=self.host,
108112
port=self.port,
113+
sslmode=self.options.get("sslmode"),
114+
sslcert=self.options.get("sslcert"),
115+
sslkey=self.options.get("sslkey"),
116+
sslrootcert=self.options.get("sslrootcert"),
109117
options=(
110118
f"-c search_path={self.schema or self.full_details.get('schema')}"
111119
if self.schema or self.full_details.get("schema")

0 commit comments

Comments
 (0)