[ 
https://issues.apache.org/jira/browse/CASSANDRA-14314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16408405#comment-16408405
 ] 

Jason Brown commented on CASSANDRA-14314:
-----------------------------------------

I've made a few changes to [~djoshi3]'s branch, which was a great step in the 
right direction, and pushed up to my repo:
||sslfactory||
|[branch|https://github.com/jasobrown/cassandra/tree/fix-args-to-sslfactory]|
|[utests & 
dtests|https://circleci.com/gh/jasobrown/workflows/cassandra/tree/fix-args-to-sslfactory]|
 - I renamed {{ConnectionType.CLIENT}} to {{ConnectionType.NATIVE_PROTOCOL}} 
(and {{ConnectionType.PEER}} to {{ConnectionType.INTERNODE_MESSAGING}}) as it 
was just confusing to me what 'client' vs 'server' really meant. The change 
ends up reading very well, especially at call sites.
 - as a petty readability change, I replaced 
{{SSLFactory.HotReloadableFile.Type}} with {{ConnectionType}}.
 - {{SSLFactory.CacheKey}} - I moved the {{equals}}/{{hashCode}} logic for 
{{EncryptionOptions}} fields into {{equals}}/{{hashCode}} functions on 
{{EncryptionOptions}} itself.
 - {{Server}} - {{ConnectionType}} should be {{CLIENT}} (now 
{{NATIVE_PROTOCOL}}) as this is where we start the server-side of the 
client-facing native protocol.
 - {{NettyFactory.OutboundInitializer.initChannel}} - {{ConnectionType}} should 
be {{PEER}} (now {{INTERNODE_MESSAGING}}) as this is where we start the 
client-side of a internode messaging connection.
 - {{SSLFactory.getSslContext}} - when {{cachedSslContexts.putIfAbsent}} is 
called, if the value is not null, we should return that value rather than using 
the instance we just created. That way we reuse the 'winning' context.
 - {{SSLFactory.createNettySslContext}} - I'm not sure we need to check if 
{{options.enabled}}. Actually, I'm not sure if there's a strong argument for 
why we should ever not load the keystore. In 3.0, we always loaded the 
keystore. wdyt?
 - Last, while I can't (or don't want to) rename the yaml properties 
({{client_encryption_options}}/{{server_encryption_options}}), I can clean up 
the code that refers to them. Hence, in DD I've changed 
{{getServerEncryptionOptions}} to {{getInternodeMessagingEncryptonOptions}} and 
so on. This make the call sites to get that data more obvious, as well. This 
change is not a requirement for this patch, but helps clarify the code.

> Fix argument passing for SSLContext in trunk
> --------------------------------------------
>
>                 Key: CASSANDRA-14314
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14314
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Dinesh Joshi
>            Assignee: Dinesh Joshi
>            Priority: Major
>              Labels: security
>
> Argument passing has a minor bug while creating the SSLContext. Audit and 
> make sure that the client & server SSL contexts are created at appropriate 
> locations.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to