惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
S
Securelist
P
Proofpoint News Feed
D
DataBreaches.Net
Cisco Talos Blog
Cisco Talos Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Project Zero
Project Zero
A
About on SuperTechFans
罗磊的独立博客
WordPress大学
WordPress大学
月光博客
月光博客
Latest news
Latest news
C
Cyber Attacks, Cyber Crime and Cyber Security
GbyAI
GbyAI
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 三生石上(FineUI控件)
F
Fortinet All Blogs
W
WeLiveSecurity
Attack and Defense Labs
Attack and Defense Labs
V
Visual Studio Blog
Blog — PlanetScale
Blog — PlanetScale
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
P
Privacy International News Feed
AI
AI
博客园 - 司徒正美
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Stack Overflow Blog
Stack Overflow Blog
M
MIT News - Artificial intelligence
Help Net Security
Help Net Security
T
Tor Project blog
V
Vulnerabilities – Threatpost
C
Cisco Blogs
I
Intezer
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
MyScale Blog
MyScale Blog
雷峰网
雷峰网
MongoDB | Blog
MongoDB | Blog
Forbes - Security
Forbes - Security
V
V2EX
Apple Machine Learning Research
Apple Machine Learning Research
T
Threat Research - Cisco Blogs
B
Blog RSS Feed
博客园 - 叶小钗
N
News and Events Feed by Topic
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Simon Willison's Weblog
Simon Willison's Weblog
C
CERT Recently Published Vulnerability Notes
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
N
News and Events Feed by Topic

博客园 - Terry Sun

Ubuntu安装Java7 SDK Postgres整理 RESTful架构API的设计误区 解决createdb: could not connect to database postgres: FATAL: Peer authentication failed for user &quot;postgres&quot; 如何升级Nginx到最新稳定版 关于Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005的解决办法 [iOS]黑色状态栏 圆角内容区 No connection could be made because the target machine actively refused it 127.0.0.1:808 的解决办法 Google Map V3--geocode与fitBounds方法的同步操作 ADO.NET Entity Framework--不再查询直接更新数据 安装SSL证书-解决导入证书时的ASN1 bad tag value met错误 解决 The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>) - Terry Sun &lt;转&gt;用HTML判断IE版本 关于Master Page的css和js文件引用问题 ASP.NET Mvc 2.0 - 2. 异步Controller执行流程时序图 [转载]ASP.NET 2.0 中的异步页 ASP.NET Mvc 2.0 - 1. Areas的创建与执行 深入分析 ASP.NET Mvc 1.0 – 4. 使用ModelBinder绑定Action的参数 深入分析 ASP.NET Mvc 1.0 – 3. Controller.Execute(Request)-ActionInvoker.InvokeAction()
The remote name could not be resolved:&#39;maps.googleapis.com&#39; 的解决办法
Terry Sun · 2012-10-24 · via 博客园 - Terry Sun

操作系统: Windows 2003(IIS 6.0)

程序类型: asp.net web application

Google Map调用方式: HttpWebResponse类去请求Google Map的static api,将HttpWebResponse获得的Stream保存为图片

通常情况下,这种做法不会有问题,部署到客户的服务器上后抛出异常:The remote name could not be resolved:'maps.googleapis.com', 但是Google Map Static Api在浏览器中可以看到地图, 研究后发现只要在asp.net的.cs文件中调用HttpWebResponse或WebClient类操作Google Map Static Api都会抛出上面的异常,在页面级调用Google Map Api不会有任何问题, 而且同样的代码在Windows Form程序中也没有问题。

发现问题: 只有通过域用户访问这个地址后才能看到图片,即使asp.net web appication集成了windows身份验证也会抛出上面的异常,但是Windows Form程序是可以看到地图图片的

解决办法: 写一个控制台应用程序使用同样的代码获取Google Map图片, 直接运行.exe程序可以获得地图图片

再次执出异常:程序中使用System.Diagnostics.Process调用这个控制台应用程序,但是在.exe程序中抛出同样的异常,但是手工执行.exe程序却没有问题, 而且在asp.net web application的日志记录的用户名是当前登录的域用户名子, .exe程序的日志记录的用户名是NETWORK SERVICE

最终解决办法:

1. web application不需要集成windows身份验证

2. 新建一个Application Pool并应用到这个web application上

3. 设置这个application pool的"Application pool identity"为一个域用户

    a. 鼠标右键点击这个application pool, 点击"Properties"

    b. 选择"Identity"标签 , 选择 "Configurable" 并输入域用户名和密码,“User name”的格式必须是 domain name\user name

4. 如果是Windows 2003系统,将这个用户再加入到IIS_WPG组中.