在Phantomjs(v 1.9.8)中使用SSL打开URL时,我遇到了问题:资源请求错误“连接已关闭”。
操作系统信息:SUSE Linux Enterprise Server 12
命令行如下:
phantomjs --ignore-ssl-errors=true --ssl-protocol=any --debug=true rasterize.js https://192.168.70.57:8072/upgrade.html test.png
详细日志:
2015-03-10T17:59:45 [DEBUG] CookieJar - Created but will not store cookies (use option '--cookies-file=' to enable persisten cookie storage)
2015-03-10T17:59:45 [DEBUG] Phantom - execute: Configuration
2015-03-10T17:59:45 [DEBUG] 0 objectName : ""
2015-03-10T17:59:45 [DEBUG] 1 cookiesFile : ""
2015-03-10T17:59:45 [DEBUG] 2 diskCacheEnabled : "false"
2015-03-10T17:59:45 [DEBUG] 3 maxDiskCacheSize : "-1"
2015-03-10T17:59:45 [DEBUG] 4 ignoreSslErrors : "true"
2015-03-10T17:59:45 [DEBUG] 5 localToRemoteUrlAccessEnabled : "false"
2015-03-10T17:59:45 [DEBUG] 6 outputEncoding : "UTF-8"
2015-03-10T17:59:45 [DEBUG] 7 proxyType : "http"
2015-03-10T17:59:45 [DEBUG] 8 proxy : ":1080"
2015-03-10T17:59:45 [DEBUG] 9 proxyAuth : ":"
2015-03-10T17:59:45 [DEBUG] 10 scriptEncoding : "UTF-8"
2015-03-10T17:59:45 [DEBUG] 11 webSecurityEnabled : "true"
2015-03-10T17:59:45 [DEBUG] 12 offlineStoragePath : ""
2015-03-10T17:59:45 [DEBUG] 13 offlineStorageDefaultQuota : "-1"
2015-03-10T17:59:45 [DEBUG] 14 printDebugMessages : "true"
2015-03-10T17:59:45 [DEBUG] 15 javascriptCanOpenWindows : "true"
2015-03-10T17:59:45 [DEBUG] 16 javascriptCanCloseWindows : "true"
2015-03-10T17:59:45 [DEBUG] 17 sslProtocol : "any"
2015-03-10T17:59:45 [DEBUG] 18 sslCertificatesPath : ""
2015-03-10T17:59:45 [DEBUG] 19 webdriver : ":"
2015-03-10T17:59:45 [DEBUG] 20 webdriverLogFile : ""
2015-03-10T17:59:45 [DEBUG] 21 webdriverLogLevel : "INFO"
2015-03-10T17:59:45 [DEBUG] 22 webdriverSeleniumGridHub : ""
2015-03-10T17:59:45 [DEBUG] Phantom - execute: Script & Arguments
2015-03-10T17:59:45 [DEBUG] script: "rasterize.js"
2015-03-10T17:59:45 [DEBUG] 0 arg: "https://192.168.70.57:8072/upgrade.html"
2015-03-10T17:59:45 [DEBUG] 1 arg: "chick.png"
2015-03-10T17:59:45 [DEBUG] Phantom - execute: Starting normal mode
2015-03-10T17:59:45 [DEBUG] WebPage - setupFrame ""
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/fs.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/system.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/_coffee-script.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/../coffee-script/package.json" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/../coffee-script/./lib/coffee-script/coffee-script.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/../coffee-script/./lib/coffee-script/./lexer.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/../coffee-script/./lib/coffee-script/././rewriter.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/../coffee-script/./lib/coffee-script/././helpers.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/../coffee-script/./lib/coffee-script/./parser.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/../coffee-script/./lib/coffee-script/./helpers.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/../coffee-script/./lib/coffee-script/./nodes.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/../coffee-script/./lib/coffee-script/././scope.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/../coffee-script/./lib/coffee-script/./././helpers.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/../coffee-script/./lib/coffee-script/././lexer.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/../coffee-script/./lib/coffee-script/./././rewriter.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/webpage.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] WebPage - updateLoadingProgress: 10
2015-03-10T17:59:45 [DEBUG] **Network - Resource request error: 2 ( "Connection closed" ) URL: "https://192.168.70.57:8072/upgrade.html"**
2015-03-10T17:59:45 [DEBUG] WebPage - updateLoadingProgress: 100
Unable to load the address!
2015-03-10T17:59:45 [DEBUG] WebPage - setupFrame ""
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/fs.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/system.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/_coffee-script.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/webpage.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] WebPage - updateLoadingProgress: 10
2015-03-10T17:59:45 [DEBUG] WebPage - setupFrame ""
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/fs.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/system.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/_coffee-script.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] FileSystem - _open: ":/modules/webpage.js" QMap(("mode", QVariant(QString, "r") ) )
2015-03-10T17:59:45 [DEBUG] WebPage - updateLoadingProgress: 100
2015-03-10T17:59:45 [DEBUG] WebPage - updateLoadingProgress: 10
2015-03-10T17:59:45 [DEBUG] WebPage - updateLoadingProgress: 100
2015-03-10T17:59:45 [DEBUG] WebPage - setupFrame ""
2015-03-10T17:59:45 [DEBUG] WebPage - setupFrame ""