扫一扫
分享文章到微信

扫一扫
关注官方公众号
至顶头条
我用同一个IP绑定不同站点,都添加了SSL,证书是同一个, 
在服务器上用shell命令执行下面命令: 
cscript.exe c:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/******/SecureBindings \":443:mysite.com\" 
可以添加IIS; 
但我用c#写的程序在本地执行时,报错: 
CScript 错误: 加载脚本“c:\Inetpub\AdminScripts\adsutil.vbs”失败(拒绝访问。 )。 
不知道是不是权限的问题,于是我在服务器上把adsutil.vbs的权限设置为erveryone后,又报了 
没有权限 
ErrNumber: 70 (0x46) 
Error Trying To SET the Property: SecureBindings 
这样的错;谁能帮我解决这个问题 
执行Shell命令的代码如下: 
string command= @"cscript.exe c:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/" + siteID + "/SecureBindings \":443:" + hostHeader + "\""; 
Process p = new Process(); 
p.StartInfo.FileName = "cmd.exe"; 
p.StartInfo.Arguments = "/c " + command; 
p.StartInfo.UseShellExecute = false; 
p.StartInfo.RedirectStandardInput = true; 
p.StartInfo.RedirectStandardOutput = true; 
p.StartInfo.RedirectStandardError = true; 
p.StartInfo.CreateNoWindow = true; 
p.Start(); 
p.StandardInput.WriteLine(command); 
p.StandardInput.WriteLine("exit"); 
log.Info("6:" + p.StandardOutput.ReadToEnd()); 
p.WaitForExit(); 
p.Close(); 
你的IIS里面是否已经有了这个网站了,你先在IIS里添加这个网站,然后将SSL端口配成444,再添加看看,如果没有加过这个站点,应该不可以使用这条命令
IIS的https一个端口只能有一个网站 
 
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。