Skip to content

Commit 48017b1

Browse files
committedNov 29, 2022
8296804: Document HttpClient configuration properties in java.net.http module-info
Reviewed-by: dfuchs, jpai
1 parent bd51b7e commit 48017b1

File tree

1 file changed

+132
-2
lines changed

1 file changed

+132
-2
lines changed
 

‎src/java.net.http/share/classes/module-info.java

+132-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,137 @@
2525

2626
/**
2727
* Defines the HTTP Client and WebSocket APIs.
28-
*
28+
* <p>
29+
* <b id="httpclientprops">System properties used by the java.net.http API</b>
30+
* <p>
31+
* The following is a list of system networking properties used by the java.net.http
32+
* client implementation in the JDK. Any properties below that take a numeric value
33+
* assume the default value if given a string that does not parse as a number.
34+
* Unless otherwise specified below, all values can be set in the {@code conf/net.properties}
35+
* file. In all cases, values can be specified as system properties on the command line,
36+
* in which case, any value in {@code conf/net.properties} is overridden. No guarantee is
37+
* provided that property values can be set programatically with {@code System.setProperty()}.
38+
* Other implementations of this API may choose not to support these properties.
39+
* <ul>
40+
* <li><p><b>{@systemProperty jdk.httpclient.allowRestrictedHeaders}</b> (default: see below)<br>
41+
* A comma-separated list of normally restricted HTTP header names that users may set in HTTP
42+
* requests or by user code in HttpRequest instances. By default, the following request
43+
* headers are not allowed to be set by user code: connection, content-length, expect, host,
44+
* and upgrade. You can override this behavior with this property. The names are case-insensitive
45+
* and whitespace is ignored. Note that this property is intended for testing and not for
46+
* real-world deployments. Protocol errors or other undefined behavior are likely to occur
47+
* when using this property. There may be other headers that are restricted from being set
48+
* depending on the context. This includes the "Authorization" header when the relevant
49+
* HttpClient has an authenticator set. These restrictions cannot be overridden by this
50+
* property.
51+
* </li>
52+
* <li><p><b>{@systemProperty jdk.httpclient.bufsize}</b> (default: 16384 bytes or 16 kB)<br>
53+
* The size to use for internal allocated buffers in bytes.
54+
* </li>
55+
* <li><p><b>{@systemProperty jdk.httpclient.connectionPoolSize}</b> (default: 0)<br>
56+
* The maximum number of connections to keep in the HTTP/1.1 keep alive cache. A value of 0
57+
* means that the cache is unbounded.
58+
* </li>
59+
* <li><p><b>{@systemProperty jdk.httpclient.connectionWindowSize}</b> (default: 2^26)<br>
60+
* The HTTP/2 client connection window size in bytes. The maximum size is 2^31-1. This value
61+
* cannot be smaller than the stream window size, which can be configured through the
62+
* {@code jdk.httpclient.windowsize} system property.
63+
* </li>
64+
* <li><p><b>{@systemProperty jdk.httpclient.disableRetryConnect}</b> (default: false)<br>
65+
* Whether automatic retry of connection failures is disabled. If false, then retries are
66+
* attempted (subject to the retry limit).
67+
* </li>
68+
* <li><p><b>{@systemProperty jdk.httpclient.enableAllMethodRetry}</b> (default: false)<br>
69+
* Whether it is permitted to automatically retry non-idempotent HTTP requests.
70+
* </li>
71+
* <li><p><b>{@systemProperty jdk.httpclient.enablepush}</b> (default: 1)<br>
72+
* Whether HTTP/2 push promise is enabled. A value of 1 enables push promise; a value of 0
73+
* disables it.
74+
* </li>
75+
* <li><p><b>{@systemProperty jdk.httpclient.hpack.maxheadertablesize}</b> (default: 16384 or
76+
* 16 kB)<br> The HTTP/2 client maximum HPACK header table size in bytes.
77+
* </li>
78+
* <li><p><b>{@systemProperty jdk.httpclient.HttpClient.log}</b> (default: none)<br>
79+
* Enables high-level logging of various events through the {@linkplain java.lang.System.Logger
80+
* Platform Logging API}. The value contains a comma-separated list of any of the
81+
* following items:
82+
* <ul>
83+
* <li>errors</li>
84+
* <li>requests</li>
85+
* <li>headers</li>
86+
* <li>content</li>
87+
* <li>frames</li>
88+
* <li>ssl</li>
89+
* <li>trace</li>
90+
* <li>channel</li>
91+
* </ul><br>
92+
* You can append the frames item with a colon-separated list of any of the following items:
93+
* <ul>
94+
* <li>control</li>
95+
* <li>data</li>
96+
* <li>window</li>
97+
* <li>all</li>
98+
* </ul><br>
99+
* Specifying an item adds it to the HTTP client's log. For example, if you specify the
100+
* following value, then the Platform Logging API logs all possible HTTP Client events:<br>
101+
* "errors,requests,headers,frames:control:data:window,ssl,trace,channel"<br>
102+
* Note that you can replace control:data:window with all. The name of the logger is
103+
* "jdk.httpclient.HttpClient", and all logging is at level INFO.
104+
* </li>
105+
* <li><p><b>{@systemProperty jdk.httpclient.keepalive.timeout}</b> (default: 30)<br>
106+
* The number of seconds to keep idle HTTP connections alive in the keep alive cache. This
107+
* property applies to both HTTP/1.1 and HTTP/2. The value for HTTP/2 can be overridden
108+
* with the {@code jdk.httpclient.keepalive.timeout.h2 property}.
109+
* </li>
110+
* <li><p><b>{@systemProperty jdk.httpclient.keepalive.timeout.h2}</b> (default: see
111+
* below)<br>The number of seconds to keep idle HTTP/2 connections alive. If not set, then the
112+
* {@code jdk.httpclient.keepalive.timeout} setting is used.
113+
* </li>
114+
* <li><p><b>{@systemProperty jdk.httpclient.maxframesize}</b> (default: 16384 or 16kB)<br>
115+
* The HTTP/2 client maximum frame size in bytes. The server is not permitted to send a frame
116+
* larger than this.
117+
* </li>
118+
* <li><p><b>{@systemProperty jdk.httpclient.maxstreams}</b> (default: 100)<br>
119+
* The maximum number of HTTP/2 push streams that the client will permit servers to open
120+
* simultaneously.
121+
* </li>
122+
* <li><p><b>{@systemProperty jdk.httpclient.receiveBufferSize}</b> (default: operating system
123+
* default)<br>The HTTP client <a href="../java.base/java/net/StandardSocketOptions.html#SO_RCVBUF">
124+
* socket receive buffer size</a> in bytes.
125+
* </li>
126+
* <li><p><b>{@systemProperty jdk.httpclient.redirects.retrylimit}</b> (default: 5)<br>
127+
* The maximum number of attempts to send a HTTP request when redirected or any failure occurs
128+
* for any reason.
129+
* </li>
130+
* <li><p><b>{@systemProperty jdk.httpclient.websocket.writeBufferSize}</b> (default: 16384
131+
* or 16kB)<br>The buffer size used by the web socket implementation for socket writes.
132+
* </li>
133+
* <li><p><b>{@systemProperty jdk.httpclient.windowsize}</b> (default: 16777216 or 16 MB)<br>
134+
* The HTTP/2 client stream window size in bytes.
135+
* </li>
136+
* <li><p><b>{@systemProperty jdk.httpclient.auth.retrylimit}</b> (default: 3)<br>
137+
* The number of attempts the Basic authentication filter will attempt to retry a failed
138+
* authentication.
139+
* </li>
140+
* <li><p><b>{@systemProperty jdk.httpclient.sendBufferSize}</b> (default: operating system
141+
* default)<br>The HTTP client socket
142+
* <a href="../java.base/java/net/StandardSocketOptions.html#SO_SNDBUF">send buffer size</a>.
143+
* Values less than or equal to zero are ignored.
144+
* </li>
145+
* <li><p><b>{@systemProperty jdk.internal.httpclient.disableHostnameVerification}</b> (default:
146+
* false)<br>If true (or set to an empty string), hostname verification in SSL certificates
147+
* is disabled. This is a system property only and not available in {@code conf/net.properties}.
148+
* It is provided for testing purposes only.
149+
* </li>
150+
* <li><p><b>{@systemProperty jdk.http.auth.proxying.disabledSchemes}</b> (default: see
151+
* conf/net.properties)<br>A comma separated list of HTTP authentication scheme names,
152+
* that are disallowed for use by the HTTP client implementation, for HTTP proxying.
153+
* </li>
154+
* <li><p><b>{@systemProperty jdk.http.auth.tunneling.disabledSchemes}</b> (default: see
155+
* conf/net.properties)<br>A comma separated list of HTTP authentication scheme names, that
156+
* are disallowed for use by the HTTP client implementation, for HTTP CONNECT tunneling.
157+
* </li>
158+
* </ul>
29159
* @moduleGraph
30160
* @since 11
31161
*/

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on Nov 29, 2022

@openjdk-notifier[bot]
Please sign in to comment.