Re: Using HTTP 1.1 over a configured HTTP2 Connector
HI Mark And Christopher, Apologies for the late response, Tomcat act as a reverse proxy to 3rd party legacy system. We have recently upgraded Tomcat to use HTTP/2 protocol; this causes the legacy system not to render and get an error message when rendering. Tomcat application war acts as a reverse proxy (which means all requests hit the web app then we have Camel Proxy to proxy to the endpoint). Browser-->HTT2-->Tomcat Web App (Reverse Proxy) -->HTT1.1 --> 3rd Party UI Since Tomcat is configured with HTTP protocol, the browser automatically negotiates the http2 protocol. Is there any way to configure some path ( /context-path/XXX) would still needs to be HTTP 1.1. Currently, the only option is for us to open different connector ports strictly with HTTP 1.1 and have traffic land here. Is there any better approach for this ? Thanks and Regards, Anurag Sharma From: Mark Thomas Date: Tuesday, October 1, 2024 at 5:38 AM To: users@tomcat.apache.org Subject: Re: Using HTTP 1.1 over a configured HTTP2 Connector CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. On 01/10/2024 06:15, Anurag Sharma wrote: > Dear Tomcat Team, > > I hope this message finds you well. > > I am currently facing a challenge regarding the use of HTTP/1.1 for specific > API endpoints within a servlet configured for HTTP/2. My browser defaults to > HTTP/2, which complicates the situation as I need to proxy some APIs to a > server that only supports HTTP/1.1. > Is there a workaround available to enforce HTTP/1.1 for these particular > endpoints? It isn't clear from the above which component needs to talk to which using what protocol. Servlets don't care whether the request is received via HTTP/1.1 or HTTP/2. Tomcat will happily process requests for the same servlet using HTTP/1.1 or HTTP/2 depending on client support. Outgoing requests from Tomcat to external services are outside of the control of Tomcat and are entirely an application concern. Can you be more precise about what the problem is? Mark > > Here is out server.xml config. All request from our app is http2 protocol. > > > protocol="org.apache.coyote.http11.Http11NioProtocol" > > relaxedPathChars="[\\]^`{|}" relaxedQueryChars="[\\]^`{|}" > > address="${tomcat.address}" minSpareThreads="100" > maxThreads="200" SSLEnabled="true" > > scheme="https" secure="true" maxSwallowSize="-1" > maxPostSize="-1"> > > readTimeout="5" streamReadTimeout ="-1" streamWriteTimeout="-1" > > overheadContinuationThreshold="0" overheadDataThreshold="0" > overheadWindowUpdateThreshold="0"/> > > > ciphers="${tomcat.ciphers}"> > > certificateKeystoreFile="/var/versa/vnms/data/certs/tomcat_keystore.jks" > > certificateKeystorePassword="${keystore.password}" > > certificateKeyPassword="${key.password}" > > certificateKeystoreType="PKCS12" /> > > > > > > > Thank you so much for your help. > > > > Thanks and Regards, > Anurag Sharma > - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Using HTTP 1.1 over a configured HTTP2 Connector
Dear Tomcat Team, I hope this message finds you well. I am currently facing a challenge regarding the use of HTTP/1.1 for specific API endpoints within a servlet configured for HTTP/2. My browser defaults to HTTP/2, which complicates the situation as I need to proxy some APIs to a server that only supports HTTP/1.1. Is there a workaround available to enforce HTTP/1.1 for these particular endpoints? Here is out server.xml config. All request from our app is http2 protocol. Thank you so much for your help. Thanks and Regards, Anurag Sharma
Re: Unable to read the orginal url when host header is specified.
I am using 9.0.31 Get Outlook for Android<https://aka.ms/ghei36> From: Mark Thomas Sent: Thursday, March 11, 2021, 11:27 PM To: users@tomcat.apache.org Subject: Re: Unable to read the orginal url when host header is specified. On 12/03/2021 01:50, Anurag Sharma wrote: > > My code is running on local host and i am hitting one of my urls as below > > curl -k -vv --http1.1 "https://localhost:8443/versa/login"; -H 'Host: > google.com' > > Now i m a trying to read the url in my code using following > > StringBuffer url = httpServletRequest.getRequestURL(); > > The value is always as follows whether the protocal HTTP/1.1 or HTTP/2 > https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgoogle.com%2Fversa%2Flogin&data=04%7C01%7Canurags%40versa-networks.com%7C8e4a356cdc8648af3dea08d8e5284124%7Cd39a23bd897c45f1a3f5c5213b673627%7C0%7C0%7C637511308345816627%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=JIFrpVVF8e2YLZYZZbVnjYGp7VzNuxPb3POsUR5c1h8%3D&reserved=0 > > how to read the original url here? Tomcat version? Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Unable to read the orginal url when host header is specified.
My code is running on local host and i am hitting one of my urls as below curl -k -vv --http1.1 "https://localhost:8443/versa/login"; -H 'Host: google.com' Now i m a trying to read the url in my code using following StringBuffer url = httpServletRequest.getRequestURL(); The value is always as follows whether the protocal HTTP/1.1 or HTTP/2 https://google.com/versa/login how to read the original url here? --- Thanks and Regards, Anurag Sharma.
Re: WELCOME to users@tomcat.apache.org
Hi My code is running on local host and i am hitting one of my urls as below curl -k -vv --http1.1 "https://localhost:8443/versa/login"; -H 'Host: google.com' Now i m a trying to read the url in my code using following StringBuffer url = httpServletRequest.getRequestURL(); The value is always as follows whether the protocal HTTP/1.1 or HTTP/2 https://google.com/versa/login how to read the original url here? --- Thanks and Regards, Anurag Sharma. From: users-h...@tomcat.apache.org Sent: 11 March 2021 17:40 To: Anurag Sharma Subject: WELCOME to users@tomcat.apache.org Hi! This is the ezmlm program. I'm managing the users@tomcat.apache.org mailing list. I'm working for my owner, who can be reached at users-ow...@tomcat.apache.org. Acknowledgment: I have added the address anur...@versa-networks.com to the users mailing list. Welcome to users@tomcat.apache.org! Please save this message so that you know the address you are subscribed under, in case you later want to unsubscribe or change your subscription address. --- Administrative commands for the users list --- I can handle administrative requests automatically. Please do not send them to the list address! Instead, send your message to the correct command address: To subscribe to the list, send a message to: To remove your address from the list, send a message to: Send mail to the following for info and FAQ for this list: Similar addresses exist for the digest list: To get messages 123 through 145 (a maximum of 100 per request), mail: To get an index with subject and author for messages 123-456 , mail: They are always returned as sets of 100, max 2000 per request, so you'll actually get 100-499. To receive all messages with the same subject as message 12345, send a short message to: The messages should contain one line or word of text to avoid being treated as sp@m, but I will ignore their content. Only the ADDRESS you send to is important. You can start a subscription for an alternate address, for example "john@host.domain", just add a hyphen and your address (with '=' instead of '@') after the command word: To stop subscription for this address, mail: In both cases, I'll send a confirmation message to that address. When you receive it, simply reply to it to complete your subscription. If despite following these instructions, you do not get the desired results, please contact my owner at users-ow...@tomcat.apache.org. Please be patient, my owner is a lot slower than I am ;-) --- Enclosed is a copy of the request I received. Return-Path: Received: (qmail 80583 invoked by uid 99); 12 Mar 2021 01:40:36 - Received: from spamproc1-he-de.apache.org (HELO spamproc1-he-de.apache.org) (116.203.196.100) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Mar 2021 01:40:36 + Received: from localhost (localhost [127.0.0.1]) by spamproc1-he-de.apache.org (ASF Mail Server at spamproc1-he-de.apache.org) with ESMTP id 6241A1FF39B for ; Fri, 12 Mar 2021 01:40:35 + (UTC) X-Virus-Scanned: Debian amavisd-new at spamproc1-he-de.apache.org X-Spam-Flag: NO X-Spam-Score: 0.199 X-Spam-Level: X-Spam-Status: No, score=0.199 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.2, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamproc1-he-de.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=versanetworks.onmicrosoft.com Received: from mx1-ec2-va.apache.org ([116.203.227.195]) by localhost (spamproc1-he-de.apache.org [116.203.196.100]) (amavisd-new, port 10024) with ESMTP id XeJgKn7lPAGk for ; Fri, 12 Mar 2021 01:40:33 + (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=40.107.243.134; helo=nam12-dm6-obe.outbound.protection.outlook.com; envelope-from=anur...@versa-networks.com; receiver= Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2134.outbound.protection.outlook.com [40.107.243.134]) by mx1-ec2-va.apache.org (ASF Mail Server at mx1-ec2-va.apache.org) with ESMTPS id 70BEFBD09A for ; Fri, 12 Mar 2021 01:40:33 + (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d5WMtT+wHRhm6Vaux09IZJSxhuyixarP00zCWVw9arvAkg/mvX5iCVcdbcrxIjVhubbwzZGxfGWMABd04CBGjiEhwUqWfUP+qtL6R5bLMXImq8WXUKy8BlER1hHredOilgSisxQQl41TtxOwWYTsJ/NRT7zTW6V55np3avAcvxHnvbeAFpiAVArtRlUwMGqsx+Omdp754wvO0XUqoXqnsb0VTv7bDVCRYCEFWuxd6KFTUGYA68WqsQDesc8gQLspWNRwlKSj5u/SvKEPH9l+yqGY39+mF5Hd4yzg9v7jkRtTZpDah6x7UdKMgh1cVyQpkF7BWq2REs7J3ECxQKN5uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject