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

Helidon Webclient fails to properly send HTTP PATCH request with Proxy (Getting Illegal Request URI Error) #3577

Closed
anand-osvc opened this issue Oct 22, 2021 · 7 comments
Assignees

Comments

@anand-osvc
Copy link

I am using Helidon Webclient class to trigger a PATCH request with an endpoint. The Webclient is configured with a proxy to perform the request. I am getting a 500, Illegal Request URI from the remote server. I have tried replacing the Helidon Webclient with 1) Apache HTTP Client, 2) JDK 11 Http Client Both worked well.

Environment Details

  • Helidon Version: 2.3.4
  • Helidon SE
  • JDK version: 11
  • OS: Oracle Linux/ Mac Big Sur
  • Docker version (if applicable): NA

Problem Description

Helidon web client fails to complete PATCH requests when the client is configured with a proxy. One finding from the debug logs was that the helidon webclient tries to send the absolute uri in the request payload where as apache client was sending only the relative url.

2021.10.13 11:07:46 FINEST io.helidon.webclient.NettyClientInitializer$ClientNettyLog Thread[helidon-client-0,10,main]: [id: 0xa7c46a33] CONNECT: aiapps-dp-fn.dq.lan/10.89.161.71:443

2021.10.13 11:07:46 FINEST io.helidon.webclient.WebClientRequestBuilderImpl Thread[helidon-client-0,10,main]: (client reqID: 5) Channel hashcode -> -1691259188

2021.10.13 11:07:46 FINEST io.helidon.webclient.RequestContentSubscriber Thread[helidon-client-0,10,main]: (client reqID: 5) Message body contains only one data chunk. Setting chunked encoding to false.

2021.10.13 11:07:46 FINEST io.helidon.webclient.NettyClientInitializer$ClientNettyLog Thread[helidon-client-0,10,main]: [id: 0xa7c46a33, L:/10.245.3.101:41006 - R:/100.111.88.146:3128] WRITE: 328B

     -------------------------------------------------

     |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f |

------------------------------------------------------++---------------

00000000 50 41 54 43 48 20 68 74 74 70 73 3a 2f 2f 61 69 PATCH https://ai
00000010 61 70 70 73 2d 64 70 2d 66 6e 2e 64 71 2e 6c 61 apps-dp-fn.dq.la
00000020 6e 3a 34 34 33 2f 73 65 72 76 69 63 65 73 2f 72 n:443/services/r
00000030 65 73 74 2f 63 6f 6e 6e 65 63 74 2f 76 31 2e 34 est/connect/v1.4
00000040 2f 69 6e 63 69 64 65 6e 74 73 2f 31 32 36 20 48 /incidents/126 H




000000c0 2f 6a 73 6f 6e 0d 0a 68 6f 73 74 3a 20 61 69 61 /json..host: aia
000000d0 70 70 73 2d 64 70 2d 66 6e 2e 64 71 2e 6c 61 6e pps-dp-fn.dq.lan
000000e0 3a 34 34 33 0d 0a 63 6f 6e 6e 65 63 74 69 6f 6e :443..connection
000000f0 3a 20 6b 65 65 70 2d 61 6c 69 76 65 0d 0a 61 63 : keep-alive..ac
00000100 63 65 70 74 2d 65 6e 63 6f 64 69 6e 67 3a 20 67 cept-encoding: g
00000110 7a 69 70 0d 0a 75 73 65 72 2d 61 67 65 6e 74 3a zip..user-agent:
00000120 20 48 65 6c 69 64 6f 6e 20 61 69 2d 61 70 70 73 Helidon ai-apps
00000130 0d 0a 63 6f 6e 74 65 6e 74 2d 6c 65 6e 67 74 68 ..content-length
00000140 3a 20 32 32 0d 0a 0d 0a : 22....
------------------------------------------------------++---------------

2021.10.13 11:07:46 FINEST io.helidon.webclient.NettyClientInitializer$ClientNettyLog Thread[helidon-client-0,10,main]: [id: 0xa7c46a33, L:/10.245.3.101:41006 - R:/100.111.88.146:3128] FLUSH

2021.10.13 11:07:46 FINEST io.helidon.webclient.RequestContentSubscriber Thread[helidon-client-0,10,main]: (client reqID: 5) Sending data chunk

2021.10.13 11:07:46 FINEST io.helidon.webclient.NettyClientInitializer$ClientNettyLog Thread[helidon-client-0,10,main]: [id: 0xa7c46a33, L:/10.245.3.101:41006 - R:/100.111.88.146:3128] WRITE: 22B

     -------------------------------------------------

     |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f |

------------------------------------------------------++---------------

00000000 7b 22 70 72 6f 64 75 63 74 22 3a 7b 22 69 64 22 {"product":{"id"
00000010 3a 33 38 31 7d 7d :381}}
------------------------------------------------------++---------------

2021.10.13 11:07:46 FINEST io.helidon.webclient.NettyClientInitializer$ClientNettyLog Thread[helidon-client-0,10,main]: [id: 0xa7c46a33, L:/10.245.3.101:41006 - R:/100.111.88.146:3128] FLUSH

2021.10.13 11:07:46 FINEST io.helidon.webclient.RequestContentSubscriber Thread[helidon-client-0,10,main]: (client reqID: 5) Sending last http content

2021.10.13 11:07:46 FINEST io.helidon.webclient.NettyClientInitializer$ClientNettyLog Thread[helidon-client-0,10,main]: [id: 0xa7c46a33, L:/10.245.3.101:41006 - R:/100.111.88.146:3128] WRITE: 0B

2021.10.13 11:07:46 FINEST io.helidon.webclient.NettyClientInitializer$ClientNettyLog Thread[helidon-client-0,10,main]: [id: 0xa7c46a33, L:/10.245.3.101:41006 - R:/100.111.88.146:3128] FLUSH

2021.10.13 11:07:46 FINEST io.helidon.webclient.RequestContentSubscriber Thread[helidon-client-0,10,main]: (client reqID: 5) Writing sending request and its content to the server.

2021.10.13 11:07:46 FINEST io.helidon.webclient.NettyClientInitializer$ClientNettyLog Thread[helidon-client-0,10,main]: [id: 0xa7c46a33, L:/10.245.3.101:41006 - R:/100.111.88.146:3128] ACTIVE

2021.10.13 11:07:46 FINEST io.helidon.webclient.NettyClientInitializer$ClientNettyLog Thread[helidon-client-0,10,main]: [id: 0xa7c46a33, L:/10.245.3.101:41006 - R:/100.111.88.146:3128] USER_EVENT: ProxyConnectionEvent(http, none, /100.111.88.146:3128 => aiapps-dp-fn.dq.lan/10.89.161.71:443)

2021.10.13 11:07:46 FINEST io.helidon.webclient.NettyClientInitializer$ClientNettyLog Thread[helidon-client-0,10,main]: [id: 0xa7c46a33, L:/10.245.3.101:41006 - R:/100.111.88.146:3128] READ COMPLETE

2021.10.13 11:07:46 FINEST io.helidon.webclient.NettyClientInitializer$ClientNettyLog Thread[helidon-client-0,10,main]: [id: 0xa7c46a33, L:/10.245.3.101:41006 - R:/100.111.88.146:3128] FLUSH

2021.10.13 11:07:46 FINEST io.helidon.webclient.NettyClientInitializer$ClientNettyLog Thread[helidon-client-0,10,main]: [id: 0xa7c46a33, L:/10.245.3.101:41006 - R:/100.111.88.146:3128] USER_EVENT: SslHandshakeCompletionEvent(SUCCESS)

2021.10.13 11:07:46 FINEST io.helidon.webclient.RequestContentSubscriber Thread[helidon-client-0,10,main]: (client reqID: 5) Data chunk sent with result: true

2021.10.13 11:07:46 FINEST io.helidon.webclient.RequestContentSubscriber Thread[helidon-client-0,10,main]: (client reqID: 5) Request sent

2021.10.13 11:07:46 FINEST io.helidon.webclient.NettyClientInitializer$ClientNettyLog Thread[helidon-client-0,10,main]: [id: 0xa7c46a33, L:/10.245.3.101:41006 - R:/100.111.88.146:3128] READ COMPLETE

2021.10.13 11:07:46 FINEST io.helidon.webclient.NettyClientInitializer$ClientNettyLog Thread[helidon-client-0,10,main]: [id: 0xa7c46a33, L:/10.245.3.101:41006 - R:/100.111.88.146:3128] FLUSH

2021.10.13 11:07:46 FINEST io.helidon.webclient.NettyClientInitializer$ClientNettyLog Thread[helidon-client-0,10,main]: [id: 0xa7c46a33, L:/10.245.3.101:41006 - R:/100.111.88.146:3128] READ: 479B

     -------------------------------------------------

     |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f |

------------------------------------------------------++---------------

00000000 48 54 54 50 2f 31 2e 31 20 35 30 30 20 49 6e 74 HTTP/1.1 500 Int
00000010 65 72 6e 61 6c 20 53 65 72 76 65 72 20 45 72 72 ernal Server Err
00000020 6f 72 0d 0a 44 61 74 65 3a 20 57 65 64 2c 20 31 or..Date: Wed, 1
00000030 33 20 4f 63 74 20 32 30 32 31 20 31 31 3a 30 37 3 Oct 2021 11:07
00000040 3a 34 36 20 47 4d 54 0d 0a 53 65 72 76 65 72 3a :46 GMT..Server:
00000050 20 41 70 61 63 68 65 0d 0a 58 2d 58 53 53 2d 50 Apache..X-XSS-P
00000060 72 6f 74 65 63 74 69 6f 6e 3a 20 31 3b 20 6d 6f rotection: 1; mo
00000070 64 65 3d 62 6c 6f 63 6b 0d 0a 58 2d 43 6f 6e 74 de=block..X-Cont
00000080 65 6e 74 2d 54 79 70 65 2d 4f 70 74 69 6f 6e 73 ent-Type-Options
00000090 3a 20 6e 6f 73 6e 69 66 66 0d 0a 52 4e 54 2d 54 : nosniff..RNT-T
000000a0 69 6d 65 3a 20 44 3d 31 37 35 38 36 33 20 74 3d ime: D=175863 t=
000000b0 31 36 33 34 31 32 33 32 36 36 37 37 30 32 30 30 1634123266770200
000000c0 0d 0a 52 4e 54 2d 4d 61 63 68 69 6e 65 3a 20 39 ..RNT-Machine: 9
000000d0 30 2e 31 32 0d 0a 58 2d 46 72 61 6d 65 2d 4f 70 0.12..X-Frame-Op
000000e0 74 69 6f 6e 73 3a 20 73 61 6d 65 6f 72 69 67 69 tions: sameorigi
000000f0 6e 0d 0a 58 2d 58 53 53 2d 50 72 6f 74 65 63 74 n..X-XSS-Protect
00000100 69 6f 6e 3a 20 31 3b 20 6d 6f 64 65 3d 62 6c 6f ion: 1; mode=blo
00000110 63 6b 0d 0a 58 2d 43 6f 6e 74 65 6e 74 2d 54 79 ck..X-Content-Ty
00000120 70 65 2d 4f 70 74 69 6f 6e 73 3a 20 6e 6f 73 6e pe-Options: nosn
00000130 69 66 66 0d 0a 56 61 72 79 3a 20 41 63 63 65 70 iff..Vary: Accep
00000140 74 2d 45 6e 63 6f 64 69 6e 67 0d 0a 43 6f 6e 74 t-Encoding..Cont
00000150 65 6e 74 2d 45 6e 63 6f 64 69 6e 67 3a 20 67 7a ent-Encoding: gz
00000160 69 70 0d 0a 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67 ip..Content-Leng
00000170 74 68 3a 20 34 31 0d 0a 58 2d 43 6e 65 63 74 69 th: 41..X-Cnecti
00000180 6f 6e 3a 20 63 6c 6f 73 65 0d 0a 43 6f 6e 74 65 on: close..Conte
00000190 6e 74 2d 54 79 70 65 3a 20 74 65 78 74 2f 70 6c nt-Type: text/pl
000001a0 61 69 6e 3b 20 63 68 61 72 73 65 74 3d 55 54 46 ain; charset=UTF
000001b0 2d 38 0d 0a 0d 0a 1f 8b 08 00 00 00 00 00 00 03 -8..............
000001c0 f3 cc c9 49 4d 4f cc 51 28 4a 2d 2c 4d 2d 2e 89 ...IMO.Q(J-,M-..
000001d0 2f 2d ca e4 e5 02 00 ea 22 42 03 15 00 00 00 /-......"B.....
------------------------------------------------------++---------------

2021.10.13 11:07:46 FINEST io.helidon.webclient.NettyClientHandler Thread[helidon-client-0,10,main]: (client reqID: 5) Initial http response message received

2021.10.13 11:07:46 FINEST io.helidon.webclient.NettyClientHandler Thread[helidon-client-0,10,main]: (client reqID: 5) Last http content received

2021.10.13 11:07:46 FINEST io.helidon.webclient.NettyClientHandler Thread[helidon-client-0,10,main]: (client reqID: 5) Closing the response from the server

2021.10.13 11:07:46 FINEST io.helidon.webclient.NettyClientInitializer$ClientNettyLog Thread[helidon-client-0,10,main]: [id: 0xa7c46a33, L:/10.245.3.101:41006 - R:/100.111.88.146:3128] CLOSE

2021.10.13 11:07:46 FINEST io.helidon.webclient.NettyClientHandler Thread[helidon-client-0,10,main]: (client reqID: 5) Response from the server has been closed

2021.10.13 11:07:46 INFO com.oracle.osvc.helidon.aiapps.AiPredict Thread[Thread-0,10,main]: CX incident ID 126 update for Tenant OSVC$102323$109475 failed with: Illegal request_uri

Steps to reproduce

  1. Configure Helidon Webclient with proxy.
  2. Hit a remote HTTP PATCH api with any json payload
  3. The request fails.
@anand-osvc
Copy link
Author

Also adding a log dump, when using apache client.

2021.10.01 07:07:12 FINE org.apache.http.headers Thread[nioEventLoopGroup-3-1,10,main]: http-outgoing-1 >> Accept-Encoding: gzip,deflate
2021.10.01 07:07:12 FINE org.apache.http.wire Thread[nioEventLoopGroup-3-1,10,main]: http-outgoing-1 >> "PATCH /services/rest/connect/v1.4/incidents/73 HTTP/1.1[\r][\n]"
2021.10.01 07:07:12 FINE org.apache.http.wire Thread[nioEventLoopGroup-3-1,10,main]: http-outgoing-1 >> "*******************[\r][\n]"
2021.10.01 07:07:12 FINE org.apache.http.wire Thread[nioEventLoopGroup-3-1,10,main]: http-outgoing-1 >> "Authorization: *********************[\r][\n]"
2021.10.01 07:07:12 FINE org.apache.http.wire Thread[nioEventLoopGroup-3-1,10,main]: http-outgoing-1 >> "Content-Type: application/json[\r][\n]"
2021.10.01 07:07:12 FINE org.apache.http.wire Thread[nioEventLoopGroup-3-1,10,main]: http-outgoing-1 >> "Content-Length: 21[\r][\n]"
2021.10.01 07:07:12 FINE org.apache.http.wire Thread[nioEventLoopGroup-3-1,10,main]: http-outgoing-1 >> "Host: ai4service-iwan-test.dq.lan[\r][\n]"
2021.10.01 07:07:12 FINE org.apache.http.wire Thread[nioEventLoopGroup-3-1,10,main]: http-outgoing-1 >> "Connection: Keep-Alive[\r][\n]"
2021.10.01 07:07:12 FINE org.apache.http.wire Thread[nioEventLoopGroup-3-1,10,main]: http-outgoing-1 >> "User-Agent: Apache-HttpClient/4.5.10 (Java/11.0.12)[\r][\n]"
2021.10.01 07:07:12 FINE org.apache.http.wire Thread[nioEventLoopGroup-3-1,10,main]: http-outgoing-1 >> "Accept-Encoding: gzip,deflate[\r][\n]"
2021.10.01 07:07:12 FINE org.apache.http.wire Thread[nioEventLoopGroup-3-1,10,main]: http-outgoing-1 >> "[\r][\n]"
2021.10.01 07:07:12 FINE org.apache.http.wire Thread[nioEventLoopGroup-3-1,10,main]: http-outgoing-1 >> "{"product":{"id":33}}"
2021.10.01 07:07:20 FINE org.apache.http.wire Thread[nioEventLoopGroup-3-1,10,main]: http-outgoing-1 << "HTTP/1.1 200 OK[\r][\n]"
2021.10.01 07:07:20 FINE org.apache.http.wire Thread[nioEventLoopGroup-3-1,10,main]: http-outgoing-1 << "Date: Fri, 01 Oct 2021 07:07:12 GMT[\r][\n]"
2021.10.01 07:07:20 FINE org.apache.http.wire Thread[nioEventLoopGroup-3-1,10,main]: http-outgoing-1 << "Server: Apache[\r][\n]"
2021.10.01 07:07:20 FINE org.apache.http.wire Thread[nioEventLoopGroup-3-1,10,main]: http-outgoing-1 << "Cache-Control: no-cache,

@spericas spericas self-assigned this Oct 22, 2021
@spericas spericas added this to the 2.4.0 milestone Oct 22, 2021
@spericas
Copy link
Member

spericas commented Oct 22, 2021

@anand-osvc Helidon sends relative URIs only if there are no proxies or if the server is in the no-proxy list. What type of server is the one rejecting the absolute URI in that request? Here is the relevant section in the HTTP spec: https://www.rfc-editor.org/rfc/rfc7230#section-5.3.2

@anand-osvc
Copy link
Author

anand-osvc commented Oct 27, 2021

@spericas I am not very sure, whether the absolute URL is the real cause of issue. With apache http client this call works good. From the trace logs, only difference I could see that Helidon sends the request with absolute url, while apache sends it with relative url. With JDK 11 HttpClient also I was able to get the call executed successfully, but I couldn't make a trace dump for JDK HttpClient. Mean time I will try provide the JDK HttpClient logs as well.

@barchetta barchetta removed this from the 2.4.0 milestone Oct 28, 2021
@istaveren
Copy link

I found a simmiar issue with a get and the proxy in 2.4.0

2021.11.03 11:29:07 FINEST io.helidon.webclient.NettyClientInitializer$ClientNettyLog Thread[helidon-client-0,5,main]: [id: 0x442f20f6, L:/10.245.62.81:47368 - R:/100.111.88.146:3128] WRITE: 470B
         +-------------------------------------------------+
         |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f |
+--------+-------------------------------------------------+----------------+
|00000000| 47 45 54 20 68 74 74 70 73 3a 2f 2f 61 69 34 73 |GET https://ai4s|
|00000010| 65 72 76 69 63 65 2d 69 77 61 6e 2d 74 65 73 74 |ervice-iwan-test|
|00000020| 2e 64 71 2e 6c 61 6e 3a 34 34 33 2f 73 65 72 76 |.dq.lan:443/serv|
|00000030| 69 63 65 73 2f 72 65 73 74 2f 63 6f 6e 6e 65 63 |ices/rest/connec|
|00000040| 74 2f 76 31 2e 34 2f 71 75 65 72 79 52 65 73 75 |t/v1.4/queryResu|
|00000050| 6c 74 73 3f 71 75 65 72 79 3d 53 45 4c 45 43 54 |lts?query=SELECT|
|00000060| 25 32 30 74 68 72 65 61 64 73 2e 74 65 78 74 25 |%20threads.text%|
|00000070| 32 30 46 52 4f 4d 25 32 30 69 6e 63 69 64 65 6e |20FROM%20inciden|
|00000080| 74 73 25 32 30 57 48 45 52 45 25 32 30 69 6e 63 |ts%20WHERE%20inc|
|00000090| 69 64 65 6e 74 73 2e 69 64 25 33 44 31 37 37 20 |idents.id%3D177 |
|000000a0| 48 54 54 50 2f 31 2e 31 0d 0a 41 75 74 68 6f 72 |HTTP/1.1..Author|
|000000b0| 69 7a 61 74 69 6f 6e 3a 20 42 61 73 69 63 20 59 |ization: Basic Y|
|000000d0| ******* 0a 6f 73 76 63 2d 63 72 |*****=..osvc-cr|
|000000e0| 65 73 74 2d 61 70 70 6c 69 63 61 74 69 6f 6e 2d |est-application-|
|000000f0| 63 6f 6e 74 65 78 74 3a 20 31 0d 0a 75 62 65 72 |context: 1..uber|
|00000100| 2d 74 72 61 63 65 2d 69 64 3a 20 34 36 66 63 33 |-trace-id: 46fc3|
|00000110| 64 64 61 32 62 32 33 38 63 65 65 3a 34 33 36 61 |dda2b238cee:436a|
|00000120| 36 39 38 64 30 62 63 62 39 63 38 37 3a 33 63 34 |698d0bcb9c87:3c4|
|00000130| 61 36 62 30 38 62 61 62 36 34 65 63 31 3a 30 0d |a6b08bab64ec1:0.|
|00000140| 0a 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 61 |.Content-Type: a|
|00000150| 70 70 6c 69 63 61 74 69 6f 6e 2f 6a 73 6f 6e 0d |pplication/json.|
|00000160| 0a 68 6f 73 74 3a 20 61 69 34 73 65 72 76 69 63 |.host: ai4servic|
|00000170| 65 2d 69 77 61 6e 2d 74 65 73 74 2e 64 71 2e 6c |e-iwan-test.dq.l|
|00000180| 61 6e 3a 34 34 33 0d 0a 63 6f 6e 6e 65 63 74 69 |an:443..connecti|
|00000190| 6f 6e 3a 20 6b 65 65 70 2d 61 6c 69 76 65 0d 0a |on: keep-alive..|
|000001a0| 61 63 63 65 70 74 2d 65 6e 63 6f 64 69 6e 67 3a |accept-encoding:|
|000001b0| 20 67 7a 69 70 0d 0a 75 73 65 72 2d 61 67 65 6e | gzip..user-agen|
|000001c0| 74 3a 20 48 65 6c 69 64 6f 6e 20 61 69 2d 61 70 |t: Helidon ai-ap|
|000001d0| 70 73 0d 0a 0d 0a                               |ps....          |
+--------+-------------------------------------------------+----------------+


         +-------------------------------------------------+
         |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f |
+--------+-------------------------------------------------+----------------+
|00000000| 48 54 54 50 2f 31 2e 31 20 35 30 30 20 49 6e 74 |HTTP/1.1 500 Int|
|00000010| 65 72 6e 61 6c 20 53 65 72 76 65 72 20 45 72 72 |ernal Server Err|
|00000020| 6f 72 0d 0a 44 61 74 65 3a 20 57 65 64 2c 20 30 |or..Date: Wed, 0|
|00000030| 33 20 4e 6f 76 20 32 30 32 31 20 31 31 3a 32 39 |3 Nov 2021 11:29|
|00000040| 3a 30 37 20 47 4d 54 0d 0a 53 65 72 76 65 72 3a |:07 GMT..Server:|
|00000050| 20 41 70 61 63 68 65 0d 0a 58 2d 58 53 53 2d 50 | Apache..X-XSS-P|
|00000060| 72 6f 74 65 63 74 69 6f 6e 3a 20 31 3b 20 6d 6f |rotection: 1; mo|
|00000070| 64 65 3d 62 6c 6f 63 6b 0d 0a 58 2d 43 6f 6e 74 |de=block..X-Cont|
|00000080| 65 6e 74 2d 54 79 70 65 2d 4f 70 74 69 6f 6e 73 |ent-Type-Options|
|00000090| 3a 20 6e 6f 73 6e 69 66 66 0d 0a 52 4e 54 2d 54 |: nosniff..RNT-T|
|000000a0| 69 6d 65 3a 20 44 3d 38 38 33 38 31 20 74 3d 31 |ime: D=88381 t=1|
|000000b0| 36 33 35 39 33 38 39 34 37 39 38 38 37 30 31 0d |635938947988701.|
|000000c0| 0a 52 4e 54 2d 4d 61 63 68 69 6e 65 3a 20 39 30 |.RNT-Machine: 90|
|000000d0| 2e 32 32 0d 0a 58 2d 46 72 61 6d 65 2d 4f 70 74 |.22..X-Frame-Opt|
|000000e0| 69 6f 6e 73 3a 20 73 61 6d 65 6f 72 69 67 69 6e |ions: sameorigin|
|000000f0| 0d 0a 58 2d 58 53 53 2d 50 72 6f 74 65 63 74 69 |..X-XSS-Protecti|
|00000100| 6f 6e 3a 20 31 3b 20 6d 6f 64 65 3d 62 6c 6f 63 |on: 1; mode=bloc|
|00000110| 6b 0d 0a 58 2d 43 6f 6e 74 65 6e 74 2d 54 79 70 |k..X-Content-Typ|
|00000120| 65 2d 4f 70 74 69 6f 6e 73 3a 20 6e 6f 73 6e 69 |e-Options: nosni|
|00000130| 66 66 0d 0a 56 61 72 79 3a 20 41 63 63 65 70 74 |ff..Vary: Accept|
|00000140| 2d 45 6e 63 6f 64 69 6e 67 0d 0a 43 6f 6e 74 65 |-Encoding..Conte|
|00000150| 6e 74 2d 45 6e 63 6f 64 69 6e 67 3a 20 67 7a 69 |nt-Encoding: gzi|
|00000160| 70 0d 0a 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67 74 |p..Content-Lengt|
|00000170| 68 3a 20 34 31 0d 0a 58 2d 43 6e 65 63 74 69 6f |h: 41..X-Cnectio|
|00000180| 6e 3a 20 63 6c 6f 73 65 0d 0a 43 6f 6e 74 65 6e |n: close..Conten|
|00000190| 74 2d 54 79 70 65 3a 20 74 65 78 74 2f 70 6c 61 |t-Type: text/pla|
|000001a0| 69 6e 3b 20 63 68 61 72 73 65 74 3d 55 54 46 2d |in; charset=UTF-|
|000001b0| 38 0d 0a 0d 0a 1f 8b 08 00 00 00 00 00 00 03 f3 |8...............|
|000001c0| cc c9 49 4d 4f cc 51 28 4a 2d 2c 4d 2d 2e 89 2f |..IMO.Q(J-,M-../|
|000001d0| 2d ca e4 e5 02 00 ea 22 42 03 15 00 00 00       |-......"B.....  |
+--------+-------------------------------------------------+----------------+

It is still sending a full URL.
Where curl does this and that works.

$ curl -u apiuser:***** -H "OSvC-CREST-Application-Context: 1"  https://ai4service-iwan-test.dq.lan:443/services/rest/connect/v1.4/queryResults?query=SELECT%20threads.text%20FROM%20incidents%20WHERE%20incidents.id%3D177 -v
* About to connect() to proxy 100.111.88.146 port 3128 (#0)
*   Trying 100.111.88.146...
* Connected to 100.111.88.146 (100.111.88.146) port 3128 (#0)
* Establish HTTP proxy tunnel to ai4service-iwan-test.dq.lan:443
* Server auth using Basic with user 'apiuser'
> CONNECT ai4service-iwan-test.dq.lan:443 HTTP/1.1
> Host: ai4service-iwan-test.dq.lan:443
> User-Agent: curl/7.29.0
> Proxy-Connection: Keep-Alive
> OSvC-CREST-Application-Context: 1
> 
< HTTP/1.1 200 Connection established
< 
* Proxy replied OK to CONNECT request
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate:
* 	subject: [email protected],OU=Hosting,L=Redwood City,ST=California,O=Oracle Corporation,C=US,CN=*.rightnow.com
* 	start date: Oct 06 18:53:29 2021 GMT
* 	expire date: Oct 06 18:53:29 2022 GMT
* 	common name: *.rightnow.com
* 	issuer: [email protected],CN=RNT Internal Certificate Authority 2021,OU=Hosting,O=Oracle Corporation,L=Bozeman,ST=Montana,C=US
* Server auth using Basic with user 'apiuser'
> GET /services/rest/connect/v1.4/queryResults?query=SELECT%20threads.text%20FROM%20incidents%20WHERE%20incidents.id%3D177 HTTP/1.1
> Authorization: Basic ********
> User-Agent: curl/7.29.0
> Host: ai4service-iwan-test.dq.lan
> Accept: */*
> OSvC-CREST-Application-Context: 1
> 
< HTTP/1.1 200 OK
< Date: Wed, 03 Nov 2021 11:43:45 GMT
< Server: Apache
< Cache-Control: no-cache, no-store, must-revalidate;
< Content-Language: en-US
< OSvC-CREST-API-ACCESS-TOKEN: *********=
< OSvC-CREST-NEXT-REQUEST-AFTER: 0
< OSvCStatus: 200
< Pragma: no-cache
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
< RNT-Time: D=231932 t=1635939825412809
< RNT-Machine: 90.22
< X-Frame-Options: sameorigin
< X-XSS-Protection: 1; mode=block
< X-Content-Type-Options: nosniff
< Content-Type: application/json
< RNT-GK-Machine: 90.44
< Content-Length: 539
< 
* Connection #0 to host 100.111.88.146 left intact
{"items":[{"tableName":"incidents","count":1,"columnNames":["text"],"rows":[[null]]}],"links":[{"rel":"self","href":"https://ai4service-iwan-test.dq.lan/services/rest/connect/v1.4/queryResults?query=SELECT%20threads.text%20FROM%20incidents%20WHERE%20incidents.id%3D177"},{"rel":"canonical","href":"https://ai4service-iwan-test.dq.lan/services/rest/connect/v1.4/queryResults"},{"rel":"describedby","href":"https://ai4service-iwan-test.dq.lan/services/rest/connect/v1.4/metadata-catalog/queryResults","mediaType":"application/schema+json"}]}

@spericas
Copy link
Member

spericas commented Nov 3, 2021

@istaveren I'm really not sure why the server that you're using insists on only accepting relative URIs. Do you have a server log with more detail about the 500 return code?

Assuming the URL is the real problem, I suppose we could add a flag to webclient to force the use of relative URLs in all cases. You'd need to enable this in your config file. Is this acceptable to you?

@spericas
Copy link
Member

spericas commented Nov 4, 2021

@istaveren Please see if the new property in #3614 can help you in your environment.

@spericas
Copy link
Member

spericas commented Nov 8, 2021

@istaveren Closing this issue after merging #3614. Hopefully the new flag will address the issue. Feel free to reopen if not.

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

No branches or pull requests

4 participants