Skip to content

Commit

Permalink
Merge pull request #73 from GSA-TTS/update-ruby-docs
Browse files Browse the repository at this point in the history
Document some known gotchas in both ruby and python apps
  • Loading branch information
rahearn authored Sep 30, 2024
2 parents f939e11 + b080d71 commit ac09fa8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Deploying this egress proxy in front of your cloud.gov application will help you
System(https_proxy, "web egress proxy", "proxy for HTTP/S connections")
}
}
Boundary(external_boundary, "external boundary") {
System(external_service, "external service", "service that the application relies on")
}
Expand Down Expand Up @@ -178,6 +178,10 @@ $ cf ssh myapp -t -c "/tmp/lifecycle/launcher /home/vcap/app /bin/bash"
If that _doesn't_ look OK: You may be using the proxy in a new or unexpected way, or you may have found a bug. Please file an issue or otherwise contact the project's maintainers!
### Language references
Gotchas found in each application language can be found within the [docs](./docs) folder.
## How it works
- The proxy runs [Caddy V2](https://caddyserver.com)
Expand Down
8 changes: 8 additions & 0 deletions docs/python.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Using cg-egress-proxy with a Python application

## SSL Certificate errors

Several environment variables need to be set for various networking libraries to load the SSL certificate used to protect the TLS connection between the application and the proxy. The following variables have been used:

* `REQUESTS_CA_BUNDLE` for the [requests](https://pypi.org/project/requests/) python library.
* `NEW_RELIC_CA_BUNDLE_PATH` for the [New Relic](https://pypi.org/project/newrelic/) SDK.
11 changes: 11 additions & 0 deletions docs/ruby.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Using cg-egress-proxy with a Ruby application

By default,[^1] `net/http` proxy support is limited to connecting to `http` proxies, and not `https` proxies. To make proxied connections in Ruby, use [Faraday](https://rubygems.org/gems/faraday) along with one of the following two adapters[^2]:

* [faraday-typhoeus](https://rubygems.org/gems/faraday-typhoeus)
* [faraday-patron](https://rubygems.org/gems/faraday-patron)

Both of those adapters should work out-of-the-box to configure themselves properly from the `http_proxy` and `https_proxy` environment variables and system certificate store.

[^1]: As of September 30, 2024
[^2]: Please update this list if you find more adapters that work. This is not exhaustive.

0 comments on commit ac09fa8

Please sign in to comment.