2021-08-30

celery任务报错:scheme https is invalid

使用websocket报错:scheme https is invalid

@app.task
def mes_push():
    num = 1
    try:
        ws = create_connection("ws://127.0.0.1/ws/applyconf")
    except Exception as e:
        print(e)
    while num < 5:
        ws.send("applyconf")
        time.sleep(5)
        num += 1
    ws.close()

我这里用到的是ws,并没有使用https,他告诉我https方案无效
当我修改成https的时候它还是报这个

ws = create_connection("https://127.0.0.1/ws/applyconf")
[2021-08-30 10:58:39,931: WARNING/ForkPoolWorker-4] scheme https is invalid

我又尝试将https换成wss结果

ws = create_connection("https://127.0.0.1/ws/applyconf")
[2021-08-30 11:03:55,111: WARNING/ForkPoolWorker-4] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131)

我现在无能为力了,请求大神帮助!!!

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值