当前位置:   article > 正文

浏览器报错:此站点的连接不安全_localhost此站点的连接不安全

localhost此站点的连接不安全

报错提示

项目上下文与问题分析

做瑞吉外卖项目时,配置过静态资源路径后,在浏览器地址栏输入https://localhost:8080/backend/index.html 访问项目资源时浏览器出现上图报错。服务器出现以下报错:

  1. 2023-02-15 11:11:29.088 INFO 10792 --- [nio-8080-exec-3] o.apache.coyote.http11.Http11Processor : Error parsing HTTP request header
  2. Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level.
  3. java.lang.IllegalArgumentException: Invalid character found in method name [0x160x030x010x020x000x010x000x010xfc0x030x030x94%r0x8a0xcb0xfa&0x090x94O0xf60xa30xbeI0xd380xc00xb60xf20x820xee0x130x8ag0xca0xe70x070x18s^t0x82]. HTTP method names must be tokens
  4. at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:417) ~[tomcat-embed-core-9.0.45.jar:9.0.45]
  5. at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:261) ~[tomcat-embed-core-9.0.45.jar:9.0.45]
  6. at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.45.jar:9.0.45]
  7. at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893) ~[tomcat-embed-core-9.0.45.jar:9.0.45]
  8. at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707) ~[tomcat-embed-core-9.0.45.jar:9.0.45]
  9. at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.45.jar:9.0.45]
  10. at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[na:na]
  11. at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[na:na]
  12. at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.45.jar:9.0.45]
  13. at java.base/java.lang.Thread.run(Thread.java:1589) ~[na:na]
  14. 2023-02-15 11:11:29.088 INFO 10792 --- [nio-8080-exec-2] o.apache.coyote.http11.Http11Processor : Error parsing HTTP request header
  15. Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level.
  16. java.lang.IllegalArgumentException: Invalid character found in method name [0x160x030x010x020x000x010x000x010xfc0x030x03O0xf6G0xd80xf00x16b0xf2@0x8d1n0xb9way0xe10x890xe10xac`0x8bW0xa90xdeN:0xc90xdfwU0xab]. HTTP method names must be tokens
  17. at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:417) ~[tomcat-embed-core-9.0.45.jar:9.0.45]
  18. at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:261) ~[tomcat-embed-core-9.0.45.jar:9.0.45]
  19. at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.45.jar:9.0.45]
  20. at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893) ~[tomcat-embed-core-9.0.45.jar:9.0.45]
  21. at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707) ~[tomcat-embed-core-9.0.45.jar:9.0.45]
  22. at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.45.jar:9.0.45]
  23. at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[na:na]
  24. at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[na:na]
  25. at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.45.jar:9.0.45]
  26. at java.base/java.lang.Thread.run(Thread.java:1589) ~[na:na]

解决办法

必须使用http://localhost:8080/backend/index.html来访问项目资源,app.listen的基本操作是创建一个http服务器并对其进行侦听,因此您必须使用http协议来访问它,而不是https。这是来自express 的应用监听的源代码: app.listen

参考资料:应用错误收集 (thinbug.com)

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/空白诗007/article/detail/796632
推荐阅读
相关标签
  

闽ICP备14008679号