Skip to content

Conversation

@mastermanu
Copy link
Member

@mastermanu mastermanu commented Oct 16, 2020

  • Adds support for specifying Server/Internode related TLS certificates using base64
  • Updates docker-compose so TLS and Cassandra can be injected using environment variables

Tested via unit tests and a private deployment

@mastermanu mastermanu marked this pull request as draft October 16, 2020 14:25
}

func (s *localStoreCertProvider) fetchServerCertificateFromInline() (*tls.Certificate, error) {
if s.tlsSettings.Server.CertData == "" {
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we return an error here?

return nil, nil
}
if s.tlsSettings.Server.InlineData && len(s.tlsSettings.Server.ClientCaData) == 0 {
return nil, nil
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we return an error here?

Copy link
Member Author

Choose a reason for hiding this comment

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

we were not returning an error before my change, but am not opposed to returnong one here given that a user who requires mutual authentication and doesn't set this has a broken environment

Copy link
Member

Choose a reason for hiding this comment

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

Disregard. My mistake, sorry.

caPool := x509.NewCertPool()

for _, ca := range caFiles {
if ca == "" {
Copy link
Member Author

Choose a reason for hiding this comment

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

did this so that we are not forced to create pass redundant variables as we did in the tls sample

if s.serverCAs != nil {
defer s.RUnlock()
return s.clientCAs, nil
return s.serverCAs, nil
Copy link
Member Author

Choose a reason for hiding this comment

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

this looks like this was an existing bug?

}
}

if cfg.TLS.CertData != "" {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Would putting this inside an else from the previous if increase readability?

Copy link
Member Author

Choose a reason for hiding this comment

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

sure, i can do else if.

@mastermanu mastermanu marked this pull request as ready for review October 16, 2020 19:04
}

if cfg.TLS.CaData != "" && cfg.TLS.CaFile != "" {
return nil, errors.New("Cannot specify both caData and caFile properties")
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this should be additive though? Because users may want multiple CA with some being intermediate and some specified in files with others in bytes?

Copy link
Member Author

Choose a reason for hiding this comment

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

talked offline. we'll keep it simple for now (also removed merging behavior for the regular TLS specifications), but if there is user interest, then we can add in merging fairly easily

@mastermanu mastermanu merged commit 7d065a2 into temporalio:master Oct 16, 2020
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.

No way to set cassandra configs (creds, tls option, etc) via docker-compose

3 participants