reCAPTCHA4j在SSL上下文中不起作用(证书问题)

时间:2013-09-04 12:27:18

标签: ssl captcha recaptcha

我在我的webapp中使用了recaptcha4j插件,但现在我需要通过SSL上下文来保护应用程序。这一步给我带来了一些问题。由于证书问题导致挑战https://api-secure.recaptcha.net/challenge?k= ........无效,因此未显示重新访问,因为2011年更改了reCaptcha SSL Api:https://groups.google.com/forum/#!topic/recaptcha/V7qswqBnA1o

出于这个原因,我必须直接使用api来解决这个问题。是否可以使用类似于recaptcha4j的插件,或者我必须用这样的东西实现recaptcha?

<script type="text/javascript"
    src="http://www.google.com/recaptcha/api/challenge?k=your_public_key">
</script>
<noscript>
   <iframe src="http://www.google.com/recaptcha/api/noscript?k=your_public_key"
       height="300" width="500" frameborder="0"></iframe><br>
   <textarea name="recaptcha_challenge_field" rows="3" cols="40">
   </textarea>
   <input type="hidden" name="recaptcha_response_field"
       value="manual_challenge">
</noscript>

在java方法中,我是否必须直接使用api进行POST来验证验证码? https://developers.google.com/recaptcha/docs/verify还是存在另一种方式呢?

2 个答案:

答案 0 :(得分:0)

JSP / JAVA reCaptcha插件未更新,谷歌更改了安全URL。在没有插件的情况下,必须在JAVA中使用recaptcha。

答案 1 :(得分:0)

该库的升级版本(0.0.8)解决了这个问题。查看here

如果您使用Maven,则必须更新依赖项,因为它已重新打包。

<dependency>
    <groupId>com.google.code.maven-play-plugin.net.tanesha.recaptcha4j</groupId>
    <artifactId>recaptcha4j</artifactId>
    <version>0.0.8</version>
</dependency>