tomcat配置SSL报错解决:java.lang.IllegalArgumentException: Invalid character (CR or LF) found in method nam
2017-08-21 14:05
633 查看
使用CAS单点登陆时,在tomcat的server.xml中配置了https协议的证书认证,但访问时报错:
折腾了很久,搜索别人的答案大多是因为SSL的配置问题,但我copy了几个博主的配置始终报错。
报错原因是因为我偷了一点点懒!。。。直接copy配置参数,没有取消掉注释自己配置,导致配置不完整出错。
如下server.xml:
修改后再次访问https的8443端口,浏览器成功跳转:
INFO [http-nio-8443-exec-4] org.apache.coyote.http11.AbstractHttp11Processor.process Error parsing HTTP request header Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level. java.lang.IllegalArgumentException: Invalid character (CR or LF) found in method name at org.apache.coyote.http11.AbstractNioInputBuffer.parseRequestLine(AbstractNioInputBuffer.java:228)
折腾了很久,搜索别人的答案大多是因为SSL的配置问题,但我copy了几个博主的配置始终报错。
报错原因是因为我偷了一点点懒!。。。直接copy配置参数,没有取消掉注释自己配置,导致配置不完整出错。
如下server.xml:
<!-- copy的配置 --> <!-- <Connector port="8443" maxHttpHeaderSize="1048576" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" disableUploadTimeout="true" acceptCount="100" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="f:/keys/my.keystore" keystorePass="xz19950122xz"/> --> <!-- 自带的配置,取消掉注释,加上keystoreFile和keystorePass --> <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="f:/keys/my.keystore" keystorePass="xz19950122xz"/>
修改后再次访问https的8443端口,浏览器成功跳转:
您的连接不是私密连接 攻击者可能会试图从 localhost 窃取您的信息(例如:密码、通讯内容或信用卡信息)。了解详情
相关文章推荐
- 解决java.lang.IllegalArgumentException: Invalid character (CR or LF) found in method name
- java.lang.IllegalArgumentException: Invalid character (CR or LF) found in method name
- tomcat服务器报 java.lang.IllegalArgumentException: Invalid character found in method name. HTTP method n
- java.lang.IllegalArgumentException: Invalid character found in method name. HTTP method names must b
- tomcat使用cookies缓存的时候中文报错解决办法 java.lang.IllegalArgumentException: Control character in cookie value or attribute.
- java.lang.IllegalArgumentException: Invalid character found in method name
- java.lang.IllegalArgumentException: Invalid character found in method name. HTTP method names must b
- java.lang.IllegalArgumentException: Invalid character found in the request target. The valid charact
- java.lang.IllegalArgumentException: Invalid character found in the request target
- java.lang.IllegalArgumentException: Invalid character found in the request target. The valid charact
- java.lang.IllegalArgumentException: Invalid character found in the request target. The valid charac
- java.lang.IllegalArgumentException: Invalid character found in the request target. The valid charact
- java.lang.IllegalArgumentException: Invalid character found in the request target.
- java.lang.IllegalArgumentException: Control character in cookie value or attribute.
- HTTP Status 500 - java.lang.IllegalArgumentException: Control character in cookie value or attribute
- 代码中发送http请求, java.lang.IllegalArgumentException: Illegal character in query at index...,非法字符错误解决办法
- 如何解决java.lang.IllegalArgumentException: Illegal character in query at index 的问题?
- java.lang.IllegalArgumentException: Illegal character in scheme at index 0 的几种解决方式
- java.lang.IllegalArgumentException: Control character in cookie value or attribute
- java.lang.IllegalArgumentException: An invalid character [44] was present in the Cookie value