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

JSSE: add Host into HTTP GET in example ClientJSSE, used with -g #213

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

cconlon
Copy link
Member

@cconlon cconlon commented Jul 19, 2024

This PR modifies the example JSSE client (ClientJSSE.java) when the -g option is used to send an HTTP GET, this adds Host: into the HTTP GET string. This allows endpoint servers to direct the request to the right location, returning a correct page instead of a bad request.

Before this change:

$ ./examples/provider/ClientJSSE.sh -h www.wolfssl.com -p 443 -d -g
...
Server message : HTTP/1.1 400 Bad Request
Date: Fri, 19 Jul 2024 19:29:38 GMT
Server: Apache
C

After adding the Host to the HTTP GET:

$ ./examples/provider/ClientJSSE.sh -h www.wolfssl.com -p 443 -d -g
...
Server message :
HTTP/1.1 200 OK
Date: Fri, 19 Jul 2024 19:33:23 GMT
Server: Apache
Link: <https://www.wolfssl.com/wp-json/>; rel="https://api.w.org/", <https://www.wolfssl.com/wp-json/wp/v2/pages/78>; rel="alternate"; type="application/json", <https://www.wolfssl.com/>; rel=shortlink
Strict-Transport-Security: max-age=31557600; includeSubDomains; preload
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin
X-Xss-Protection: 1; mode=block
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

1ef7
<!DOCTYPE html>
<html lang="en-US" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
<head>
<meta charset="UTF-8">
...

@cconlon cconlon self-assigned this Jul 19, 2024
@cconlon cconlon force-pushed the ClientJSSEAddGETHost branch from 801d78d to 1abeaf1 Compare July 19, 2024 19:39
@dgarske dgarske merged commit 59aaba2 into wolfSSL:master Aug 1, 2024
35 checks passed
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.

4 participants