I’m using recaptcha on my java jsp setup. I use the following code in my jsp
<%@ page import="net.tanesha.recaptcha.ReCaptcha"%>
<%@ page import="net.tanesha.recaptcha.ReCaptchaFactory"%>
<%
ReCaptcha c = ReCaptchaFactory.newReCaptcha("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXX", false);
out.print(c.createRecaptchaHtml(null, null));
out.flush();
%>
However the site uses https so I’m getting an ‘Only secure content is displayed’ message on IE.
If I look at the source recaptcha has generated the following
<script type="text/javascript" src="http://api.recaptcha.net/challenge?k=XXXXXXXXXXXXXXXXXXXXXXX"></script>
How do I force recaptcha to use https and not http?
Looking at the source code, you need to change:
with:
That’s it!
See also