Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Make strict hostname checking optional on SSL #178

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ List of config parameters:
| ssl_ca | string | No | - | for self-signed SSL |
| ssl_cert | string | No | - | for self-signed SSL |
| ssl_key | string | No | - | for self-signed SSL |
| check_hostname | string | No | true | Whether or not to enforce strict host name checking on the SSL certificate
| internal_hostname | string | No | - | Override match hostname for google cloud |
| session_sqls | List of strings | No | ```['SET @@session.time_zone="+0:00"', 'SET @@session.wait_timeout=28800', 'SET @@session.net_read_timeout=3600', 'SET @@session.innodb_lock_wait_timeout=3600']``` | Set session variables dynamically. |

Expand Down
10 changes: 7 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
long_description = fh.read()

setup(name='pipelinewise-tap-mysql',
version='1.5.6',
version='1.5.15',
description='Singer.io tap for extracting data from MySQL & MariaDB - PipelineWise compatible',
long_description=long_description,
long_description_content_type='text/markdown',
Expand All @@ -20,10 +20,14 @@
install_requires=[
'pendulum==2.1.2',
'pipelinewise-singer-python==1.*',
'mysql-replication==0.43',
'mysql-replication==1.0.9',
'singer-python==5.13.0',
'tzlocal==5.1',
'PyMySQL==1.1.*',
'plpygis==0.2.1',
'tzlocal==2.1',
'python-dateutil==2.8.*',
'six==1.15.*',
'packaging==24.0'
],
extras_require={
'test': [
Expand Down
3 changes: 3 additions & 0 deletions tap_mysql/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ def __init__(self, config):
"cursorclass": config.get("cursorclass") or pymysql.cursors.SSCursor,
"connect_timeout": CONNECT_TIMEOUT_SECONDS,
"charset": "utf8",
"read_timeout": 60,
"write_timeout": 60
}

ssl_arg = None
Expand Down Expand Up @@ -122,6 +124,7 @@ def __init__(self, config):
"ca": "./ca.pem",
"cert": "./cert.pem",
"key": "./key.pem",
"check_hostname": config.get("check_hostname", "true")
}

# override match hostname for google cloud
Expand Down
1 change: 1 addition & 0 deletions tap_mysql/sync_strategies/full_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def pks_are_auto_incrementing(mysql_conn, catalog_entry):
with connect_with_backoff(mysql_conn) as open_conn:
with open_conn.cursor() as cur:
for primary_key in key_properties:
open_conn.ping(reconnect=True)
cur.execute(sql.format(database_name,
catalog_entry.table,
primary_key))
Expand Down