Solved

InternetOpen proxy server configuration question for services

Posted on 2006-11-28
5
1,566 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
  • 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Converting to C# also VS2015 5 125
Visual c++ and text files 7 67
Parsing XML instructions in Java/any other language.... 3 110
Excel/Word Add-in in what language? 5 118
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

773 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