Skip to content

refactor: enforce https for post requests - #1

Open
deepsource-dev-autofix[bot] wants to merge 1 commit into
2.6.2-basefrom
deepsource-autofix-21934112
Open

refactor: enforce https for post requests#1
deepsource-dev-autofix[bot] wants to merge 1 commit into
2.6.2-basefrom
deepsource-autofix-21934112

Conversation

@deepsource-dev-autofix

Copy link
Copy Markdown

This PR replaces the previous HttpURLConnection usage with HttpsURLConnection, enforcing TLS for all outgoing POST requests and any redirects. We import and configure SSLSocketFactory to ensure encrypted data in transit and throw an exception if an insecure (non-HTTPS) protocol is detected.

  • Cleartext Submission of Sensitive Information: The original code allowed HTTP connections, risking exposure of sensitive data. We now check the URL protocol and only allow HTTPS, casting to HttpsURLConnection and setting the default SSLSocketFactory for TLS encryption. An assumption is made that the default SSLSocketFactory is correctly configured with the appropriate truststore and certificates; please review your SSL/TLS settings to confirm they meet your security requirements.

This Autofix was generated by AI. Please review the change before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants