Skip to content

Commit

Permalink
Merge pull request #481 from oscar-system/bl/cacert
Browse files Browse the repository at this point in the history
ca-cert: use NetworkOptions instead of jll
  • Loading branch information
benlorenz authored Mar 27, 2024
2 parents ad3143a + 2fc20be commit 0bd0469
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/runtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
with:
cache-name: julia-cache;workflow=${{ github.workflow }};julia=${{ matrix.julia-version }};arch=${{ runner.arch }}
include-matrix: false
cache-scratchspaces: false
- name: "pin CxxWrap"
if: matrix.cxxwrap != ''
run: julia --project -e 'using Pkg; pkg"add CxxWrap@${{ matrix.cxxwrap }}"; pkg"pin CxxWrap";'
Expand Down Expand Up @@ -112,6 +113,7 @@ jobs:
with:
cache-name: julia-cache;workflow=${{ github.workflow }};julia=${{ matrix.julia-version }};arch=${{ runner.arch }}
include-matrix: false
cache-scratchspaces: false
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Mongoc = "4fe8b98c-fc19-5c23-8ec2-168ff83495f2"
MozillaCACerts_jll = "14a3606d-f60d-562e-9121-12d972cd8159"
NetworkOptions = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
Ninja_jll = "76642167-d241-5cee-8c94-7a494e8cb7b7"
Perl_jll = "83958c19-0796-5285-893e-a1267f8ec499"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Expand All @@ -30,7 +30,7 @@ Downloads = "^1.4"
JSON = "^0.20, ^0.21"
Libdl = "^1.6"
Mongoc = "~0.6.0, ~0.7.0, ~0.8.0, ~0.9.0"
MozillaCACerts_jll = "2020 - 2024"
NetworkOptions = "1.2"
Ninja_jll = "^1.11.1"
Perl_jll = "^5.34.0"
Pkg = "^1.6"
Expand Down
9 changes: 4 additions & 5 deletions src/polydb.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
module Polydb

using Polymake
using ..Polymake

# julia itself also has a cert.pem but this one should be more recent
# and provides a variable for the path
using MozillaCACerts_jll
# for ca certificates
import NetworkOptions

import Mongoc

Expand Down Expand Up @@ -62,7 +61,7 @@ Polymake.Polydb.Database
"""
function get_db()
# we explicitly set the cacert file, otherwise we might get connection errors because the certificate cannot be validated
client = Mongoc.Client(get(ENV, "POLYDB_TEST_URI", "mongodb://polymake:database@db.polymake.org/?authSource=admin&ssl=true&sslCertificateAuthorityFile=$(MozillaCACerts_jll.cacert)"))
client = Mongoc.Client(get(ENV, "POLYDB_TEST_URI", "mongodb://polymake:database@db.polymake.org/?authSource=admin&ssl=true&sslCertificateAuthorityFile=$(NetworkOptions.ca_roots_path())"))
return Database(client["polydb"])
end

Expand Down

0 comments on commit 0bd0469

Please sign in to comment.