Commit f88fd61
committed
GH-5723: Refine SSL trust all configuration for http client builder
RDF4JHttpClientConfig
- Added disableHostnameVerification boolean field (default false),
getter, and builder method with security-warning Javadoc.
ApacheHC5RDF4JHttpClientFactory
- Added javax.net.ssl.SSLContext and NoopHostnameVerifier imports.
- The TLS strategy block now covers both cases: if
disableHostnameVerification is true, NoopHostnameVerifier.INSTANCE is
passed to DefaultClientTlsStrategy; if only a custom SSLContext is set,
the default verifier is used. If neither flag applies, no custom
strategy
is set.
JdkRDF4JHttpClientFactory
- Added javax.net.ssl.SSLParameters import.
- When disableHostnameVerification is true, sets
endpointIdentificationAlgorithm to null via SSLParameters, which is the
JDK way to disable hostname checking.
HttpClientBuilders.getSslTrustAllConfig()
- Now calls .disableHostnameVerification(true) so the returned config
disables both certificate validation and hostname verification, matching
the "trust all" contract.
- Updated Javadoc to accurately describe what the method does (both
checks suppressed) and to include the production warning.1 parent 2a5954f commit f88fd61
4 files changed
Lines changed: 68 additions & 5 deletions
File tree
- core/http
- client-apache5/src/main/java/org/eclipse/rdf4j/http/client/apache5
- client-api/src/main/java/org/eclipse/rdf4j/http/client/spi
- client-jdk/src/main/java/org/eclipse/rdf4j/http/client/jdk
- client/src/main/java/org/eclipse/rdf4j/http/client/util
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
87 | 90 | | |
88 | 91 | | |
89 | 92 | | |
90 | | - | |
91 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
92 | 106 | | |
93 | 107 | | |
94 | 108 | | |
| |||
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| 63 | + | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| |||
147 | 149 | | |
148 | 150 | | |
149 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
150 | 166 | | |
151 | 167 | | |
152 | 168 | | |
| |||
189 | 205 | | |
190 | 206 | | |
191 | 207 | | |
| 208 | + | |
192 | 209 | | |
193 | 210 | | |
194 | 211 | | |
| |||
201 | 218 | | |
202 | 219 | | |
203 | 220 | | |
| 221 | + | |
204 | 222 | | |
205 | 223 | | |
206 | 224 | | |
| |||
307 | 325 | | |
308 | 326 | | |
309 | 327 | | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
310 | 344 | | |
311 | 345 | | |
312 | 346 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
49 | 57 | | |
50 | 58 | | |
51 | 59 | | |
| |||
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
35 | 42 | | |
36 | 43 | | |
37 | 44 | | |
| |||
52 | 59 | | |
53 | 60 | | |
54 | 61 | | |
55 | | - | |
| 62 | + | |
56 | 63 | | |
57 | 64 | | |
58 | 65 | | |
| |||
0 commit comments