如何抑制phpseclib“无效的HMAC"?警告 [英] How to suppress phpseclib "Invalid HMAC" warning

查看:285
本文介绍了如何抑制phpseclib“无效的HMAC"?警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用phpseclib通过SFTP传输文件,但是登录失败

I am using phpseclib to transfer files via SFTP, but login fails with

无效的HMAC

Invalid HMAC

我需要忽略此服务器警告.

I need to ignore this server warning.

例如,使用curl命令,我使用-k选项.我可以用phplibsec做同样的事情吗?

For example with curl command I use the -k option. Can I do the same with phplibsec?

-k,-不安全(SSL)此选项明确允许curl执行不安全"的SSL连接和传输.所有SSL连接均为 试图通过使用CA证书捆绑包使其安全 默认情况下安装.这使得所有连接都被视为不安全" 除非使用-k,--insecure否则失败.

-k, --insecure (SSL) This option explicitly allows curl to perform "insecure" SSL connections and transfers. All SSL connections are attempted to be made secure by using the CA certificate bundle installed by default. This makes all connections considered "insecure" fail unless -k, --insecure is used.

推荐答案

无效的HMAC"不是警告,而是致命错误.你不能压制它.

The "Invalid HMAC" is not a warning, it's a fatal error. You cannot suppress it.

该错误表明服务器与phpseclib客户端之间的通信存在误解.

The error indicates there's some misunderstanding in communication between the server and the phpseclib client.

该错误与主机密钥验证"无关.与大多数SSH客户端相反,phpseclib实际上甚至不验证主机密钥.您自己编写了代码.

The error has nothing to do with the "host key verification". Contrary to majority of SSH clients, the phpseclib does not actually even verify the host key. You have code this yourself.

请参见 http://phpseclib.sourceforge.net/ssh/2.0/examples.html#oneoff,hostkey

(但同样,这与您得到的错误无关)

(but again, this has nothing to do with the error you are getting)

这篇关于如何抑制phpseclib“无效的HMAC"?警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆