Reputation: 423
I am using application to display the Http image url in the RSS. But while loading this image in the HTTPS server and opening in Internet Explorer showing Security warning. How to solve this problem? How this can be handled using java and display in RSS?
Upvotes: 0
Views: 1333
Reputation: 122649
If the image (or other content) is hosted on the same host, the simplest is to use a relative-path reference or an absolute-path reference (i.e. src="path/to/image.png"
or src="/path/to/image.png
).
If the image is on a different host that serves the same content over HTTPS (with a certificate likely to be trusted by your users too) and plain HTTP (at least for this resource), use a network-path (relative) reference, i.e. omit the scheme from the URI (e.g. src="//the.host.name/path/to/image.png"
).
If that other host doesn't serve this content over HTTPS, this becomes more complex. One work-around is to serve it yourself via a reverse-proxy which would query this content. The address used by the client would point to your HTTPS server, and your server would fetch the content in the back. You may want to consider the following points when doing this:
Upvotes: 0
Reputation: 359816
Use scheme-relative URLs. That mean URLs that look like this:
<img src="//example.com/images/foo.jpg"/>
instead of this:
<img src="http://example.com/images/foo.jpg"/>
More reading: Is it valid to replace http:// with // in a <script src="http://...">?
Upvotes: 1
Reputation: 7438
I don't know Java, but you could do :
var STRING
IF SSL DETECTED
STRING = REPLACE HTTP WITH HTTPS
ECHO STRING
Do this inside the loop.
The best way to do it is to create two main constant with both url in http and https and use thoses as prefix in your url whatever SSL is detected or not.
Upvotes: 0