Servlets Apache Tomcat 5.X HTTPS服务器配置未接收POST请求数据
我面临一个Tomcat服务器配置问题 我已经从GoDaddy请求了一个证书,并用ApacheTomcat 5.x配置了相同的证书。以下是HTTPS配置的Servlets Apache Tomcat 5.X HTTPS服务器配置未接收POST请求数据,servlets,configuration,https,tomcat5.5,google-glass,Servlets,Configuration,Https,Tomcat5.5,Google Glass,我面临一个Tomcat服务器配置问题 我已经从GoDaddy请求了一个证书,并用ApacheTomcat 5.x配置了相同的证书。以下是HTTPS配置的tomcat5.x\conf\server.xml中的代码片段 <Connector port="8443" maxHttpHeaderSize="8192" protocol="HTTP/1.1" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
tomcat5.x\conf\server.xml
中的代码片段
<Connector port="8443" maxHttpHeaderSize="8192" protocol="HTTP/1.1"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
keystoreFile="/path/to/tomcat.keystore" keystorePass="xxxxxxxxx"
clientAuth="false" sslProtocol="TLS" SSLEnabled="false"/>
Log.info
语句总是打印“获取原始通知”
,这意味着没有可用的数据
以前的
有趣的是,当部署Servlet
或使用HTTP而不是HTTPS进行访问时,它可以工作
更新
我尝试使用HTTP和HTTPS将curl(JSON数据)转换为相同的Servlet
,但这两种方式都不起作用。在本地服务器上,它正在工作
老实说,我在配置ApacheTomcat服务器和SSL证书方面没有太多经验。我遵循了GoDaddy提供的配置步骤,当然还有Google的帮助
// Respond with OK and status 200 in a timely fashion to prevent redelivery
response.setContentType("text/html");
Writer writer = response.getWriter();
writer.append("OK");
writer.close();
// Get the notification object from the request body (into a string so we
// can log it)
BufferedReader notificationReader =
new BufferedReader(new InputStreamReader(request.getInputStream()));
String notificationString = "";
// Count the lines as a very basic way to prevent Denial of Service attacks
int lines = 0;
while (notificationReader.ready()) {
notificationString += notificationReader.readLine();
lines++;
// No notification would ever be this long. Something is very wrong.
if (lines > 1000) {
throw new IOException("Attempted to parse notification payload that was unexpectedly long.");
}
}
LOG.info("got raw notification " + notificationString);