Skip to content

Outbound: Specify the OpenSSL Root CA Bundle when making SDS requests#191

Merged
adrianclay merged 15 commits intomainfrom
NIAD-3169-certificate-fix
Sep 6, 2024
Merged

Outbound: Specify the OpenSSL Root CA Bundle when making SDS requests#191
adrianclay merged 15 commits intomainfrom
NIAD-3169-certificate-fix

Conversation

@Alex-Nita
Copy link
Copy Markdown
Contributor

@Alex-Nita Alex-Nita commented Aug 30, 2024

What + Why

When testing the Adaptor in PTL, we noticed that the first Outbound request would return a successful response, and then all subsequent requests returned a 500. We narrowed the issue down to the tornado HTTP client reusing the last CA Bundle it was given if no CA Bundle was explicitly specified. After the first request, this meant that SDS requests were trying to validate the authenticity of the SDS API by using the NHS root certificates (because the last request made was to Spine).

To workaround this Tornado issue, this we've changed our CommonHttps.make_request method to explicitly specify the OpenSSL root CA bundle in the case that no bundle is provided. This should only affect the calls to the FHIR SDS API, as that's the only HTTP server we call that uses a standard certificate. Calls to Spine use the NHS certificates passed in as environment variables.

Type of change

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the Changelog with details of my change in the UNRELEASED section if this change will affect end users. No CHANGELOG entry required, as this fixes a bug in code which hasn't been released yet.

@Alex-Nita Alex-Nita requested a review from adrianclay August 30, 2024 09:49
Comment thread mhs/outbound/main.py Outdated
Comment thread common/comms/common_https.py Outdated
@Alex-Nita Alex-Nita changed the title Updated tornado http client config to use the simple client instead of curl Fix certificate issues Sep 4, 2024
Comment thread mhs/outbound/main.py Outdated
Comment thread mhs/outbound/main.py Outdated
@adrianclay adrianclay changed the title Fix certificate issues Specify the OpenSSL Root CA Bundle when making SDS requests Sep 6, 2024
@adrianclay adrianclay changed the title Specify the OpenSSL Root CA Bundle when making SDS requests Outbound: Specify the OpenSSL Root CA Bundle when making SDS requests Sep 6, 2024
@adrianclay adrianclay merged commit 94a6433 into main Sep 6, 2024
@adrianclay adrianclay deleted the NIAD-3169-certificate-fix branch September 6, 2024 15:24
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.

2 participants