Skip to content

Run against secure servers#116

Merged
tbg merged 4 commits intomasterfrom
ssl
Aug 20, 2020
Merged

Run against secure servers#116
tbg merged 4 commits intomasterfrom
ssl

Conversation

@tbg
Copy link
Copy Markdown
Member

@tbg tbg commented Aug 19, 2020

It turns out that even though we had introduced functionality to run against
secure CRDB in cockroach-go, we had never actually started to use it here.

This series of commits fixes that.

Unfortunately, it turns out that this won't just work out of the box for
many of the ORMs, and we have to stay insecure. Notably:

  • GoPG has no client cert support
  • Hibernate doesn't unescape the paths in the URL correctly and fails to find
    the certs
  • Sequelize and Django don't pick up the options from the query string

This leaves only GORM, SQLAlchemy, and ActiveRecord actually running securely.

Interestingly, the tenant proxy, which I originally intended to use here,
could make this work better since it does not require client certs.

tbg added 4 commits August 19, 2020 16:46
This picks up the option to start a tenant proxy. It also
fixes up the certificates used for tenants.
Switch to an options-struct pattern to de-noise the test. This was
prompted by the need to add an option that will only be used by
a few tests, in a future commit.
@tbg tbg requested a review from rafiss August 19, 2020 14:50
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@rafiss rafiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, thank you for the updates

Reviewable status: 0 of 10 files reviewed, 1 unresolved discussion (waiting on @rafiss and @tbg)


testing/main_test.go, line 403 at r4 (raw file):

		tableNames:  djangoTestTableNames,
		columnNames: djangoTestColumnNames,
		// No support for client certs (at least not via the query string).

seems like it would work with making a settings.py, but i guess that would be too large of a refactor?
https://stackoverflow.com/questions/35869001/django-connection-to-postgresql-using-cert-authentication

@tbg
Copy link
Copy Markdown
Member Author

tbg commented Aug 20, 2020

Yeah, I think (hope) that all of these could actually work, at least through the proxy (where all you need is server ssl and password auth), but I didn't want to get into that in the first PR. My end goal is that, though, so there will be more.

TFTR!

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.

3 participants