Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finagle-mysql: Add support of opportunistic TLS
Problem Currently a finagle-mysql client supports only two TLS modes: it is either enabled and the server must support it too, or it is disabled and then it doesn't matter whether the server supports TLS or not. Solution We introduce a new mode `desired`, when the client will use TLS if the server supports it, but will remain operational and use plaintext if it doesn't JIRA Issues: GRAPH-13420 Differential Revision: https://phabricator.twitter.biz/D644982
- Loading branch information
Showing
5 changed files
with
91 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...ql/src/main/scala/com/twitter/finagle/mysql/InsufficientServerCapabilitiesException.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.twitter.finagle.mysql | ||
|
||
import com.twitter.finagle.FailureFlags | ||
import java.sql.SQLNonTransientException | ||
|
||
/** | ||
* Indicates that the server lacks required capabilities | ||
*/ | ||
class InsufficientServerCapabilitiesException( | ||
required: Capability, | ||
available: Capability, | ||
val flags: Long = FailureFlags.NonRetryable) | ||
extends SQLNonTransientException( | ||
s"Insufficient capabilities: available: '$available', required: '$required'") | ||
with FailureFlags[InsufficientServerCapabilitiesException] { | ||
|
||
protected def copyWithFlags(flags: Long): InsufficientServerCapabilitiesException = | ||
new InsufficientServerCapabilitiesException(required, available, flags) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters