Skip to content

feat: enable SSL connections #358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Sep 25, 2022
Merged

feat: enable SSL connections #358

merged 10 commits into from
Sep 25, 2022

Conversation

olavloite
Copy link
Collaborator

@olavloite olavloite commented Sep 15, 2022

Adds support for SSL connections to PGAdapter. PGAdapter supports the following three SSL modes:

  1. Disabled (default): SSL connections are not accepted. Clients that require SSL will fail to connect. (This is equivalent to the current behavior before this change)
  2. Enabled: SSL connections are accepted if the client requests one. Non-SSL connections are also accepted.
  3. Required: SSL connections are accepted if the client requests one. Non-SSL connections are denied. This only applies to TCP connections. Unix Domain Sockets are still allowed in this mode (unless Unix Domain Sockets have been disabled).

Running PGAdapter with SSL enabled requires that a keystore with a SSL certificate has been configured. This can be done with the javax.net.ssl.keyStore system property (e.g. -Djavax.net.ssl.keyStore=/path/to/my/keystore.pfx) or by adding the certificate to the default keystore.

Adds support for SSL connections to PGAdapter.
@codecov
Copy link

codecov bot commented Sep 15, 2022

Codecov Report

Merging #358 (155eeb0) into postgresql-dialect (7e2fc78) will increase coverage by 0.26%.
The diff coverage is 91.47%.

@@                   Coverage Diff                    @@
##             postgresql-dialect     #358      +/-   ##
========================================================
+ Coverage                 85.96%   86.23%   +0.26%     
- Complexity                 1765     1798      +33     
========================================================
  Files                       120      121       +1     
  Lines                      5863     5955      +92     
  Branches                    800      813      +13     
========================================================
+ Hits                       5040     5135      +95     
+ Misses                      595      593       -2     
+ Partials                    228      227       -1     
Flag Coverage Δ
all_tests 86.23% <91.47%> (+0.26%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ava/com/google/cloud/spanner/pgadapter/Server.java 48.38% <0.00%> (-7.17%) ⬇️
...om/google/cloud/spanner/pgadapter/ProxyServer.java 80.92% <80.00%> (-0.17%) ⬇️
...gle/cloud/spanner/pgadapter/ConnectionHandler.java 84.22% <92.40%> (+5.14%) ⬆️
...gle/cloud/spanner/pgadapter/error/PGException.java 100.00% <100.00%> (ø)
...spanner/pgadapter/metadata/ConnectionMetadata.java 100.00% <100.00%> (ø)
...ud/spanner/pgadapter/metadata/OptionsMetadata.java 81.25% <100.00%> (+1.25%) ⬆️
...panner/pgadapter/wireoutput/AcceptSSLResponse.java 100.00% <100.00%> (ø)
...oud/spanner/pgadapter/wireprotocol/SSLMessage.java 88.88% <100.00%> (+15.55%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@olavloite olavloite marked this pull request as ready for review September 19, 2022 12:35
@olavloite olavloite merged commit c856ce2 into postgresql-dialect Sep 25, 2022
@olavloite olavloite deleted the ssl branch September 25, 2022 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant