-
Notifications
You must be signed in to change notification settings - Fork 157
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
Added EncryptionLevel.REQUIRED_NON_LOCAL #191
Conversation
@@ -72,6 +73,11 @@ | |||
public interface Driver extends AutoCloseable | |||
{ | |||
/** | |||
* Return a flag to indicate whether or not encryption is used for this driver. | |||
*/ | |||
boolean encrypted(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this method should be named #isEncrypted()
to signify that it is a configuration option check and not some soft of a fluent interface.
*/ | ||
public static boolean isLocalhost( String host ) | ||
{ | ||
return LOCALHOST.matcher( host ).matches(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a good way to check for localhost. There can be multiple network cards, interfaces and what not. Plus regex matches things like 127.99999.99.123123123123
. Class InetAddress
has methods like #isAnyLocalAddress()
, #isLoopbackAddress()
. It seems to be useful to check if address is defined on any interface like this NetworkInterface.getByInetAddress(address) != null
. I guess we can adopt smth similar to http://stackoverflow.com/a/2406819/5517896
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiple network cards don't apply here. We're talking about the address to which the client connects and whether that is equal to localhost
or 127.x.x.x
.
I'm also not sure that 127.99999.99.123123123123
would actually be a valid IP address anyway. But I'll check out the utility methods you mention. We do need to make sure we catch localhost
here as well as the raw IP addresses so I'll work out which one(s) do that.
No description provided.