Solved

InternetOpen proxy server configuration question for services

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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 pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

930 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now