我正在使用Microsoft.XMLHTTP调用调用web服务:
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("POST", "/xxx/Converter.asmx/Convert", false);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.send("conversionFolder=" + escape(conversionFolder));
if (xmlhttp.status == 200) {
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = "false";
xmlDoc.loadXML(xmlhttp.responseText);
... more stuff ...
return str;
}
else {
alert(xmlhttp.statusCode + " - " + xmlhttp.statusText);
}
Run Code Online (Sandbox Code Playgroud)
当我记得在本地web.config中添加HttpPost协议时,一切正常.
<?xml version="1.0"?>
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<webServices>
<protocols>
<add name="HttpPost"/>
</protocols>
</webServices>
<compilation debug="false"></compilation>
</system.web>
<system.codedom>
</system.codedom>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not …Run Code Online (Sandbox Code Playgroud) 最近,Chrome已停止显示通过jsonp加载的数据并显示错误
[已屏蔽] https://user.example.com/category/12345上的页面运行了来自http://livedata.example.com/Data.svc/jsonp/GetData?category=12345&callback=_jsp&_1346417951424=的不安全内容.
它仍适用于所有其他浏览器,并已在运行Chrome的几台不同计算机上得到确认.
我之前看到过这个问题的唯一提法是,该页面是从Google自己的某个域提供的(我猜是Google Apps的安全功能吗?),这是现在在最新版本中已在所有域上启用的内容Chrome?
理想情况下,我们不希望在我们的livingata子域上启用https,因为它会导致额外的服务器负载,数据全部公开,因此没有迫切需要加密它.
我需要从Java网站上的SSL证书中提取到期日期,应该支持可信和自签名证书,例如:1.trusted https://github.com 2.self-signed https://mms.nw .RU /
我已经将一些代码复制为:
import java.net.URL;
import java.security.SecureRandom;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.KeyManager;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
public class SSLTest {
public static void main(String [] args) throws Exception {
// configure the SSLContext with a TrustManager
SSLContext ctx = SSLContext.getInstance("TLS");
ctx.init(new KeyManager[0], new TrustManager[] {new DefaultTrustManager()}, new SecureRandom());
SSLContext.setDefault(ctx);
URL url = new URL("https://github.com");//https://mms.nw.ru
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
conn.setHostnameVerifier(new HostnameVerifier() {
@Override
public boolean …Run Code Online (Sandbox Code Playgroud) 是否有可能(通过IAM,存储桶策略或其他方式)强制Amazon S3 仅通过HTTPS/SSL提供内容并拒绝所有常规的,未加密的HTTP访问?
我必须为网站添加ssl(https),我获得了SSL.CSR和SSL.KEY文件.我'dos2unix'ed他们(因为他们尾随^ M)并将它们复制到服务器(CSR - > mywebsite.crt,KEY - > mywebsite.key).我对nginx.conf进行了以下修改:
@@ -60,8 +60,13 @@
}
server {
- listen 80;
+ listen 443;
server_name ...;
+ ssl on;
+ ssl_certificate mywebsite.crt;
+ ssl_certificate_key mywebsite.key;
+ ssl_session_cache shared:SSL:10m;
+ ssl_session_timeout 10m;
# Set the max size for file uploads to 500Mb
client_max_body_size 500M;
Run Code Online (Sandbox Code Playgroud)
重新启动nginx时发生错误:
nginx: [emerg] PEM_read_bio_X509_AUX("/etc/nginx/mywebsite.crt") failed (SSL: error:0906D06C:PEM routines:PEM_read_bio:no start line:Expecting: TRUSTED CERTIFICATE)
Run Code Online (Sandbox Code Playgroud)
我认为这是因为mywebsite.crt文件的第一行包含'REQUEST',所以我从第一行和最后一行删除'REQUEST',然后再次重启nginx,并点击另一个错误:
nginx: [emerg] PEM_read_bio_X509_AUX("/etc/nginx/mywebsite.crt") failed (SSL: error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag error:0D06C03A:asn1 encoding routines:ASN1_D2I_EX_PRIMITIVE:nested asn1 error error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested …Run Code Online (Sandbox Code Playgroud) 我正在将REST API用于Cisco CMX设备,并尝试编写Python代码,该代码向API发出GET请求以获取信息.代码如下,除了更改必要的信息外,与文件中的代码相同.
from http.client import HTTPSConnection
from base64 import b64encode
# Create HTTPS connection
c = HTTPSConnection("0.0.0.0")
# encode as Base64
# decode to ascii (python3 stores as byte string, need to pass as ascii
value for auth)
username_password = b64encode(b"admin:password").decode("ascii")
headers = {'Authorization': 'Basic {0}'.format(username_password)}
# connect and ask for resource
c.request('GET', '/api/config/v1/aaa/users', headers=headers)
# response
res = c.getresponse()
data = res.read()
Run Code Online (Sandbox Code Playgroud)
但是,我不断收到以下错误:
Traceback (most recent call last):
File "/Users/finaris/PycharmProjects/test/test/test.py", line 14, in <module>
c.request('GET', '/api/config/v1/aaa/users', …Run Code Online (Sandbox Code Playgroud) 谷歌Chrome突然将我的虚拟主机域myapplication.dev重定向到https://myapplication.dev.我已经试着去了
铬://网内部/#HSTS
并将myapplication.dev输入最底部的文本框"删除域安全策略",但这没有任何效果.
我还试图删除浏览器数据.
我还做的是将v-host更改为.app而不是.dev,但Chrome仍然将我重定向到https:// ...
这是在Laragon上运行的Laravel应用程序.在同一网络中的其他PC上,它运行良好.
我正在寻找将 async / await 与 https post 一起使用的方法。请帮帮我。我已经在下面发布了我的 https 帖子代码片段。如何使用异步等待。
const https = require('https')
const data = JSON.stringify({
todo: 'Buy the milk'
})
const options = {
hostname: 'flaviocopes.com',
port: 443,
path: '/todos',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': data.length
}
}
const req = https.request(options, (res) => {
console.log(`statusCode: ${res.statusCode}`)
res.on('data', (d) => {
process.stdout.write(d)
})
})
req.on('error', (error) => {
console.error(error)
})
req.write(data)
req.end()
Run Code Online (Sandbox Code Playgroud) 更新:请注意,在不安全的HTTP和加密的HTTPS页面之间切换的每个网站都不可避免地容易出现SSL剥离.请考虑在整个站点使用HTTPS,虽然这既不能阻止SSL-strip,但至少这样可以让用户安全地调用站点,如果他在意的话.对于需要切换的站点,此方法可能仍是最佳选择.
这是一种常见的情况,即网站包含敏感数据的页面,只能使用HTTPS协议1访问,而其他页面应使用非关键数据访问.
我找到了一个解决方案,允许在安全和非安全页面之间切换,同时保持会话,并想要询问有关该概念中的缺陷的任何提示.你可以在这里找到整篇文章: 使用SSL安全会话cookie (当然我也很高兴听到,这是安全的).
问题
HTTPS确保客户端和服务器之间没有人可以窃听我们的通信并防止中间人攻击.不幸的是,这不适用于session-cookie,它也被发送到未加密的请求.
PHP使用参数$ secure提供函数session_set_cookie_params(...).这就是我们所需要的,但是当我们切换到不安全的页面时,它会让我们忘记我们的会话.
身份验证Cookie
身份验证cookie的想法是,当用户输入密码(增加其访问权限)时,我们会在不安全的会话cookie之外创建第二个cookie,并确保只有加密的HTTPS页面才能访问它.
https://www.example.com/login.php
<?php
session_start();
// regenerate session id to make session fixation more difficult
session_regenerate_id(true);
// generate random code for the authentication cookie and store it in the session
$authCode = md5(uniqid(mt_rand(), true));
$_SESSION['authentication'] = $authCode;
// create authentication cookie, and restrict it to HTTPS pages
setcookie('authentication', $authCode, 0, '/', '', true, true);
print('<h1>login</h1>');
...
?>
Run Code Online (Sandbox Code Playgroud)
现在,每个页面(HTTPS和HTTP)都可以读取不安全的会话cookie,但是包含敏感信息的页面可以检查安全身份验证cookie.
https://www.example.com/secret.php
<?php
session_start();
// check that the …Run Code Online (Sandbox Code Playgroud) 嗨我在一个选项卡上通过chrome运行几千个https客户端,我似乎在浏览器中达到了限制,当我检查任务管理器时,该选项卡的chrome进程使用了高达897MB,所以我假设有某种限制(900MB~).
周围是否有任何镀铬向导可以解释这一点,因为我无法在网上找到任何东西,如果我可以增加最大限制,那么这将是理想的,因此我可以通过单个选项卡运行更多客户端.
谢谢!