Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ben Olsen
committed
Nov 4, 2018
1 parent
014f939
commit 9b1557d
Showing
4 changed files
with
27 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
defmodule AWSX509.Example do | ||
def connect do | ||
cert_dir = "/home/username/certs/" | ||
{:ok, conn} = Mongo.start_link( | ||
database: "database", | ||
hostname: "mongodb.company.com", | ||
username: "CN=username,OU=unit,O=company,L=Location,ST=State,C=US", | ||
password: "foo", # needs a dummy string. but would be nice if it could ignore this for X509 | ||
ssl: true, | ||
auth_mechanism: :x509, | ||
ssl_opts: [ | ||
ciphers: ['AES256-GCM-SHA384'], # needed to connect to AWS | ||
cacertfile: Path.join([cert_dir, "rootca.pem"]), | ||
certfile: Path.join([cert_dir, "mycert.pem"]) | ||
] | ||
) | ||
conn | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters