收藏
回答

微信小程序连接后台的时候报错?

VM14:2 (in promise) MiniProgramError
{"errMsg":"request:fail -113:net::ERR_SSL_VERSION_OR_CIPHER_MISMATCH"}
Object

但是本地测试和postman连接都没问题,只有在调试和测试的时候没法获取数据,后台用的是nginx转发+springboot.求大佬帮忙看一下具体是哪里的问题,报错好像是ssl证书的问题.

附上nginx的配置

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        \logs\nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs\access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;
server {
    listen 80 default_server;
    listen [::]:80 default_server;

    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name ****************; 
    ssl_certificate ../*****.cer;
    ssl_certificate_key ../*****.key;
    ssl_session_timeout 1d;
    ssl_session_cache shared:MozSSL:10m;  # about 40000 sessions
    ssl_session_tickets off;

    # modern configuration
    ssl_protocols TLSv1.3;
    ssl_prefer_server_ciphers off;

    # HSTS (ngx_http_headers_module is required) (63072000 seconds)
    add_header Strict-Transport-Security "max-age=63072000" always;

    # OCSP stapling
    ssl_stapling on;
    ssl_stapling_verify on;
    location / {
    proxy_pass http://*********:8080;   
}

    # replace with the IP address of your resolver
    resolver 127.0.0.1;
}

}
回答关注问题邀请回答
收藏

1 个回答

  • 听风
    听风
    03-29

    问题解决了,安卓不支持TLSv1.3版本的证书所以才会出问题

    03-29
    有用 1
    回复 1
    • 听风
      听风
      03-29
      更改证书配置就解决了..挺简单的错误..
      03-29
      回复
登录 后发表内容
问题标签