Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP/2 support in AITs #2111

Open
jtduffy opened this issue Oct 29, 2024 · 2 comments
Open

HTTP/2 support in AITs #2111

jtduffy opened this issue Oct 29, 2024 · 2 comments

Comments

@jtduffy
Copy link
Contributor

jtduffy commented Oct 29, 2024

Evaluate the existing AITs and see which ones would be candidates for adding coverage for HTTP/2 support.

List of HTTP/2 client and server frameworks:
https://docs.google.com/spreadsheets/d/150ntwH2aO9Sr6mg0lVVkNScmLKSJpxNZXhqAoTHKo5U/edit?gid=0#gid=0

Enable HTTPS and HTTP/2 for Spring Boot 3 / Spring Framework 6 Apps

Generate a self signed localhost cert:
-keystore keystore.p12 -storetype PKCS12 -storepass password -validity 9999

This will create the keystore keystore.p12 in the current folder. Copy this file into the
src/main/resources folder of the application.

Update the application.properties or application.yml file to reference the keystore:

server.port=8443
server.http2.enabled=true
server.ssl.key-alias=localhost
server.ssl.key-store=classpath:keystore.p12
server.ssl.key-store-password=password
server.ssl.key-store-type=PKCS12
server:
  port: 8443
  http2:
    enabled:true
  ssl:
    key-store: classpath:keystore.p12
    key-store-password: password
    key-store-type: PKCS12
    key-alias: localhost

This will start the app with HTTPS and HTTP/2 support listening on port 8443.

@workato-integration
Copy link

@jasonjkeller
Copy link
Contributor

Here's the PR that added an HTTP/2 compatible client to the AITs and documents a few setup steps: https://github.com/newrelic/java-agent-integration-tests/pull/257

By default, when creating the http client I set verify=False so that it won't be a huge hassle to manage certs with HTTP/2.

httpx.Client(http2=True, follow_redirects=True, verify=False)

verify - (optional) SSL certificates (a.k.a CA bundle) used to verify the identity of requested hosts. Either True (default CA bundle), a path to an SSL certificate file, an ssl.SSLContext, or False (which will disable verification).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants