PhantomJS failing to open HTTPS site

后端 未结 12 1784
梦如初夏
梦如初夏 2020-11-22 07:53

I\'m using the following code based on loadspeed.js example to open up a https:// site which requires http server authentication as well.

var page = require(         


        
相关标签:
12条回答
  • 2020-11-22 08:19

    experienced same issue...
    --ignore-ssl-errors=yes was not enough to fix it for me, had to do two more things:
    1) change user-agent
    2) tried all ssl-protocols, the only one that worked was tlsv1 for the page in question
    Hope this helps...

    0 讨论(0)
  • 2020-11-22 08:19

    I was receiving

    Error creating SSL context" from phantomJS (running on CentOS 6.6)

    Building from source fixed it for me. Don't forget to use the phantomjs that you built. (instead of the /usr/local/bin/phantomjs if you have it)

    sudo yum -y install gcc gcc-c++ make flex bison gperf ruby openssl-devel freetype-devel fontconfig-devel libicu-devel sqlite-devel libpng-devel libjpeg-devel
    git clone git://github.com/ariya/phantomjs.git
    cd phantomjs
    git checkout 2.0
    ./build.sh
    cd bin/
    ./phantomjs <your JS file>
    
    0 讨论(0)
  • 2020-11-22 08:19

    If someone is using Phantomjs with Sahi the --ignore-ssl-errors option needs to go in your browser_types.xml file. It worked for me.

    <browserType>
        <name>phantomjs</name>
        <displayName>PhantomJS</displayName>
        <icon>safari.png</icon>
        <path>/usr/local/Cellar/phantomjs/1.9.2/bin/phantomjs</path>
        <options>--ignore-ssl-errors=yes --debug=yes --proxy=localhost:9999 /usr/local/Cellar/phantomjs/phantom-sahi.js</options>
        <processName>"PhantomJS"</processName>
        <capacity>100</capacity>
        <force>true</force>
    </browserType>
    
    0 讨论(0)
  • 2020-11-22 08:24

    I experienced the same problem (casperjs 1.1.0-beta3/phantomjs 1.9.7). Using --ignore-ssl-errors=yes and --ssl-protocol=tlsv1 solved it. Using only one of the options did not solve it for me.

    0 讨论(0)
  • 2020-11-22 08:26

    The only thing that worked for me was upping phantomjs from 1.9x to 2.x ;)

    0 讨论(0)
  • 2020-11-22 08:27

    On the machine you are trying to run phantomjs on to connect to a remote server, run "openssl ciphers." Copy and paste the ciphers listed into the --ssl-ciphers="" command line option. This tells the connecting web server which ciphers are available to use to communicate with your client. If you don't set the ones available on your own machine, it can use any cipher your machine does not understand that the default modern browsers do that are used for the default setting.

    0 讨论(0)
提交回复
热议问题