proxy pass https question
-
Hi all, I have a tricky situation, with which I would very much appreciate a little advice: I have a C# Control for embedding a flash swf in a page. The 'codebase' and 'pluginspage' attributes of the object tag require urls (e.g. http://www.macromedia.com/go/getflashplayer) If the page is being served over https, of course that url should change to: https://www.macromedia.com/go/getflashplayer ...to prevent the browser alerting you about mixing secure and non-secure objects. Now here's the problem: Our hosting environment has a linux server as the only outward-facing IP, and we are using the apache proxy pass module to serve our .net sites from a windows machine. So the linux box serves on http or https. The windows box is only http. My C# control, sitting on the windows box needs to know which to embed the flash as. I hoped I could use the IsSecureConnection property of the request object, but that only sees the request from the linux box, which is http. The full path of the url is no help either - same thing. I hope I have explained this sufficiently well. If anyone has any ideas I would love to hear them. Many thanks Steven
-
Hi all, I have a tricky situation, with which I would very much appreciate a little advice: I have a C# Control for embedding a flash swf in a page. The 'codebase' and 'pluginspage' attributes of the object tag require urls (e.g. http://www.macromedia.com/go/getflashplayer) If the page is being served over https, of course that url should change to: https://www.macromedia.com/go/getflashplayer ...to prevent the browser alerting you about mixing secure and non-secure objects. Now here's the problem: Our hosting environment has a linux server as the only outward-facing IP, and we are using the apache proxy pass module to serve our .net sites from a windows machine. So the linux box serves on http or https. The windows box is only http. My C# control, sitting on the windows box needs to know which to embed the flash as. I hoped I could use the IsSecureConnection property of the request object, but that only sees the request from the linux box, which is http. The full path of the url is no help either - same thing. I hope I have explained this sufficiently well. If anyone has any ideas I would love to hear them. Many thanks Steven
Any future questions about ASP.NET (in any language) should actually be posted in the ASP.NET[^] forum. ASP.NET will only know what it is asked. If the linux box is asking requesting a resource over HTTP, that's all it will know. You need some way to tell the Windows box which is being requested. I recommend taking a look at the apache mod APIs for that caching proxy mod you're using to see if there's any exported APIs, otherwise there's really no way to tell. One more idea is to actually have to separate URLs (they could map the same directory/file, though) so that the ASP.NET page (or whatever) can easily distinguish between the two requests. You can't use IIS's virtual directory functionality because this will actually create a separate web application with a different AppDomains. Instead, you could either use two separate pages or use a custom
IHttpHandler
implementation which is pretty easy. Read a recent article in MSDN, Serving Dynamic Content with HTTP Handlers[^], for a good example and discussion.Microsoft MVP, Visual C# My Articles
-
Any future questions about ASP.NET (in any language) should actually be posted in the ASP.NET[^] forum. ASP.NET will only know what it is asked. If the linux box is asking requesting a resource over HTTP, that's all it will know. You need some way to tell the Windows box which is being requested. I recommend taking a look at the apache mod APIs for that caching proxy mod you're using to see if there's any exported APIs, otherwise there's really no way to tell. One more idea is to actually have to separate URLs (they could map the same directory/file, though) so that the ASP.NET page (or whatever) can easily distinguish between the two requests. You can't use IIS's virtual directory functionality because this will actually create a separate web application with a different AppDomains. Instead, you could either use two separate pages or use a custom
IHttpHandler
implementation which is pretty easy. Read a recent article in MSDN, Serving Dynamic Content with HTTP Handlers[^], for a good example and discussion.Microsoft MVP, Visual C# My Articles
Hi Heath, Thank you so much for replying so fully, and I'm sorry I haven't got back to you till now. Point taken about which forum this should be on. The separate URL idea could be a winner, also I noticed the REMOTE_PORT header variable is different in both cases so may be able to do something there. I read the articles on HTTP Handlers, thank you - very interesting. In fact though, I thought of a rather lazy, well - frankly low down and dirty way of getting around this: I can just have the codebase url as https the whole time! It seems to work perfectly well and is certainly a lot more straight forward. Do you think this is sufficient? Thank you again for getting back to me Best Wishes Steven
-
Hi Heath, Thank you so much for replying so fully, and I'm sorry I haven't got back to you till now. Point taken about which forum this should be on. The separate URL idea could be a winner, also I noticed the REMOTE_PORT header variable is different in both cases so may be able to do something there. I read the articles on HTTP Handlers, thank you - very interesting. In fact though, I thought of a rather lazy, well - frankly low down and dirty way of getting around this: I can just have the codebase url as https the whole time! It seems to work perfectly well and is certainly a lot more straight forward. Do you think this is sufficient? Thank you again for getting back to me Best Wishes Steven
It would work, but you're putting an extra burden on the client and server to encrypt communications to send the control(s). It may be negligible, however, so it really is up to your implementation.
Microsoft MVP, Visual C# My Articles