eclipse-kura / kura

Eclipse Kura™ is a versatile framework to supercharge your edge devices, streamlining the process of configuring your gateway, connecting sensors, and IoT devices to seamlessly collect, process, and send data to the cloud.
https://eclipse.dev/kura/
Eclipse Public License 2.0
498 stars 305 forks source link

feat: Disable HTTP trace #5204

Closed MMaiero closed 5 months ago

MMaiero commented 5 months ago

Previous to this change:

Issue reported by a user and verified with the following call:

➜  ~ curl -v -X TRACE <https://192.168.1.219>
*   Trying 192.168.1.219:443...
* Connected to 192.168.1.219 (192.168.1.219) port 443
* ALPN: curl offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* SSL certificate problem: self signed certificate
* Closing connection
curl: (60) SSL certificate problem: self signed certificate
More details here: <https://curl.se/docs/sslcerts.html>

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
➜  ~ curl -k -v -X TRACE <https://192.168.1.219>
*   Trying 192.168.1.219:443...
* Connected to 192.168.1.219 (192.168.1.219) port 443
* ALPN: curl offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-AES256-GCM-SHA384
* ALPN: server did not agree on a protocol. Uses default.
* Server certificate:
*  subject: C=CA; ST=Ontario; L=Ottawa; O=Eclipse Foundation; OU=Kura; CN=Kura
*  start date: Feb 22 11:16:16 2024 GMT
*  expire date: Nov 18 11:16:16 2026 GMT
*  issuer: C=CA; ST=Ontario; L=Ottawa; O=Eclipse Foundation; OU=Kura; CN=Kura
*  SSL certificate verify result: self signed certificate (18), continuing anyway.
* using HTTP/1.x
> TRACE / HTTP/1.1
> Host: 192.168.1.219
> User-Agent: curl/8.4.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Thu, 22 Feb 2024 13:42:28 GMT
< X-FRAME-OPTIONS: SAMEORIGIN
< X-XSS-protection: 1; mode=block
< X-Content-Type-Options: nosniff
< Cache-Control: no-cache,no-store,must-revalidate
< Pragma: no-cache
< Content-Type: message/http
< Content-Length: 76
<
TRACE / HTTP/1.1
Accept: */*
User-Agent: curl/8.4.0
Host: 192.168.1.219
* Connection #0 to host 192.168.1.219 left intact

After the change:

➜  ~ curl -k -v -X TRACE https://192.168.1.219
*   Trying 192.168.1.219:443...
* Connected to 192.168.1.219 (192.168.1.219) port 443
* ALPN: curl offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-AES256-GCM-SHA384
* ALPN: server did not agree on a protocol. Uses default.
* Server certificate:
*  subject: C=CA; ST=Ontario; L=Ottawa; O=Eclipse Foundation; OU=Kura; CN=Kura
*  start date: Apr  8 13:18:56 2024 GMT
*  expire date: Jan  3 13:18:56 2027 GMT
*  issuer: C=CA; ST=Ontario; L=Ottawa; O=Eclipse Foundation; OU=Kura; CN=Kura
*  SSL certificate verify result: self signed certificate (18), continuing anyway.
* using HTTP/1.x
> TRACE / HTTP/1.1
> Host: 192.168.1.219
> User-Agent: curl/8.4.0
> Accept: */*
>
< HTTP/1.1 403 Forbidden
< Content-Length: 0
<
* Connection #0 to host 192.168.1.219 left intact
MMaiero commented 5 months ago

The build succeeds locally but we are facing an issue in the CI connection to Sonar. An issue has been raised few weeks ago to the Eclipse Team: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/4422

Merging as-is for now.