【发布时间】:2019-05-08 06:35:03
【问题描述】:
我使用Swift 和UIWebView
WebView.loadHTMLString(string, baseURL: nil) 并得到一个错误,
2019-05-08 13:52:58.758899+0800 钱包[439:41398] [] nw_coretls_callback_handshake_message_block_invoke_3 tls_handshake_continue: [-9807] 2019-05-08 13:52:58.813981+0800 钱包[439:41413] NSURLSession/NSURLConnection HTTP 加载失败 (kCFStreamErrorDomainSSL, -9843)
大部分类似的问题使用URLRequest,和我不同,
这是我的字符串
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Demo</title>
</head>
<body>
<form action="https://**.****.**.***:29843/Pay/order/Order.htm" method="post">
<input type="text" name="merchantName" value="net">
</form>
</body>
</html>
here I replace the ip address with *
override func viewDidLoad() {
super.viewDidLoad()
WebView.loadHTMLString(mystring, baseURL: nil) //mystring'value is above
WebView.delegate = self
}
func webViewDidFinishLoad(_ webView: UIWebView) {
webView.stringByEvaluatingJavaScript(from: "document.getElementById('frmBankID').submit(); ")
}
现在我的iphone是白屏,我只是想显示页面,完全不介意安全性,任何方式获取页面,谢谢
【问题讨论】: