I have a https link that requires user login & password. If I run it in FX like this: https://usernameassword@www.example.com/link/sublink
我有一个https链接,需要用户登录和密码。如果我在FX中运行它,请执行以下操作:https://usernameassword@www.example.com/link/sublink
it will return the xml data as expected.
它将按预期返回xml数据。
However, what i'm trying to do, is to automate this process. I try to use file_get_contents() in PHP.
但是,我正在尝试做的是自动执行此过程。我尝试在PHP中使用file_get_contents()。
I even tried to use AJAX, but still doesn't work.
我甚至尝试使用AJAX,但仍然无法正常工作。
I tried to get the content (XML) either in Server or in the front-end (ajax), but both don't work.
我试图在服务器或前端(ajax)中获取内容(XML),但两者都不起作用。
Does anyone know what I need to go in order to get the content? Do I need to obtain the SSL certificate?
有谁知道我需要去获取内容?我需要获取SSL证书吗?
Solution in any ohter languages will be welcome too.
任何欧姆语言的解决方案也将受到欢迎。
3 个解决方案
#2
1
You should use curl library, also certificate should be verified if you want to prevent man-in-the-middle attacks. Or just ignore it using curl options.
你应该使用curl库,如果你想防止中间人攻击,也应该验证证书。或者只是使用curl选项忽略它。
#3
1
cURL or wget with SSL support.
cURL或wget with SSL support。
cURL, you can run either through the compiled PHP library or call the executable from PHP.
cURL,您可以通过编译的PHP库运行或从PHP调用可执行文件。
Wget, you will have to call the executable.
Wget,你必须调用可执行文件。
#1
#2
1
You should use curl library, also certificate should be verified if you want to prevent man-in-the-middle attacks. Or just ignore it using curl options.
你应该使用curl库,如果你想防止中间人攻击,也应该验证证书。或者只是使用curl选项忽略它。
#3
1
cURL or wget with SSL support.
cURL或wget with SSL support。
cURL, you can run either through the compiled PHP library or call the executable from PHP.
cURL,您可以通过编译的PHP库运行或从PHP调用可执行文件。
Wget, you will have to call the executable.
Wget,你必须调用可执行文件。