Skip to content

Commit ef7106f

Browse files
authored
Merge pull request #72 from JoeJesse/master
Fix SSL bug when connecting using AWSPREVIOUS
2 parents f7663e7 + cfc069e commit ef7106f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

SecretsManagerMongoDBRotationSingleUser/lambda_function.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,14 @@ def set_secret(service_client, arn, token):
172172

173173
# Now try the current password
174174
conn = get_connection(current_dict)
175+
176+
# If both current and pending do not work, try previous
175177
if not conn and previous_dict:
176178
# If both current and pending do not work, try previous
177-
conn = get_connection(previous_dict)
179+
# Update previous_dict to leverage current SSL settings
180+
previous_dict.pop('ssl', None)
181+
if 'ssl' in current_dict:
182+
previous_dict['ssl'] = current_dict['ssl']
178183

179184
# Make sure the user/host from previous and pending match
180185
if previous_dict['username'] != pending_dict['username']:

0 commit comments

Comments
 (0)