-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Add support for specifying server_hostname via SNI when connecting #325
Conversation
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.
LGTM.
Please fix flake8
error as well.
clickhouse_driver/connection.py
Outdated
@@ -122,7 +127,7 @@ class Connection(object): | |||
""" | |||
|
|||
def __init__( | |||
self, host, port=None, | |||
self, host, port=None, server_hostname=None, |
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.
server_hostname
parameter should be placed at the end or in the "Secure socket parameters" section right after keyfile=None, certfile=None
which is preferrable.
This will keep backwards compatibility for those who constructs client like Client('localhost', 9000, 'user', 'pass', 'mydb')
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.
ah, good feedback, done
And add |
Thanks! |
This specifically allows connections to be made over SSH tunnels via separately setting the
server_hostname
when constructing the SSL wrapper. Without this, one would have to modify/etc/hosts
to achieve the same effect which isn't always possible in all environments.