Solved

InternetOpen proxy server configuration question for services

Posted on 2006-11-28
5
1,611 Views
Last Modified: 2012-06-21
I have a windows service that uses the LocalAdmin account for authentication.  It generates HTTPS (SSL) requests every 24 hours to verify/validate license information.

It currently uses INTERNET_OPEN_TYPE_DIRECT for its queries:

   InternetOpen("AppName Here", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);

This works fine for users with firewalls, but does not work for companies that use proxy type firewalls.

So there's really two questions that need to be answered:

1) What AccessType should be used in the InternetOpen function call so it will work with proxy firewalls?

2) Will this AccessType work for a service that runs in the background (no user context or HKEY_CURRENT_USER registry entries for proxy information).
0
Comment
Question by:ttitus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 18034199
You should use 'INTERNET_OPEN_TYPE_PROXY', as listed in http:://msdn.microsoft.com/library/en-us/wininet/wininet/internetopen.asp

That will/should work for any user account a service runs under except LocalSystem (given that the user in question has that proxy set - even services have a HKEY_CURRENT_USER).
0
 

Author Comment

by:ttitus
ID: 18034213
Sorry, I should have mentioned that this account DOES run under LocalSystem.  What needs to happen then?
0
 
LVL 86

Expert Comment

by:jkr
ID: 18034554
You would need to have to assign the network access privileges to that account also.
0
 

Author Comment

by:ttitus
ID: 18038576
Ok, one list question:  Will INTERNET_OPEN_TYPE_PROXY revert to INTERNET_OPEN_TYPE_DIRECT if there is no proxy configured for that user?
0
 
LVL 86

Accepted Solution

by:
jkr earned 250 total points
ID: 18038733
In that case, you should use INTERNET_OPEN_TYPE_PRECONFIG - see http://msdn.microsoft.com/library/en-us/wininet/wininet/enabling_internet_functionality.asp ("Enabling Internet Functionality"):

INTERNET_OPEN_TYPE_PRECONFIG looks at the registry values ProxyEnable, ProxyServer, and ProxyOverride. These values are located under "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings".

If ProxyEnable is zero, the application uses INTERNET_OPEN_TYPE_DIRECT. Otherwise, the application uses INTERNET_OPEN_TYPE_PROXY and uses the ProxyServer and ProxyOverride information

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question