Skip to content
Advertisement

How to Log/ View AWS Java SDK HTTP(S) Requests

I am developing a Spring Boot Application that uses HTTPS Only. I am using AWS services and the corresponding AWS Java SDK. How can I view the HTTP(S) request that the java sdk methods call on the backend of my application? I want to make sure when doing uploads to S3, etc, that everything is done over HTTPS only as the security of this application is important. A little confused on how to see when the backend of the application is interacting with the AWS services. Thanks in advance.

Advertisement

Answer

AWS uses HTTPS by default for all communications, and gives you options (such as VPC endpoints) that prevent traffic from leaving the AWS VPC.

Unfortunately, I couldn’t find a reference in the Java SDK documentation that says it follows this practice. You can find guarantees for individual services (for example, S3). And it’s implied that the SDK uses TLS by the page that describes how to enforce using TLS 1.2.

However, if you really want to be sure, you need to enable logging at the wire level.


Update in response to comment:

I ran the following program with debugging on:

JavaScript

Looking at the logs, it’s definitely making an HTTPS connection:

JavaScript

That’s followed by the TLS negotiation, and then the actual request. One thing that may be confusing, if you’re not familiar with the HTTP protocol, is this:

JavaScript

That’s the HTTP request line, and the “HTTP/1.1” indicates the protocol version. This information is sent over the secure connection.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement