Set system proxy && authentication in C++ on Windows - c++

Is there a way in C++ to set the Windows system proxy with authentication credentials so it would affect all running programs(browsers, etc...) immediatly but:
Not requiring restarting any browser
Not requiring browser-reauthentication
I am looking really for a system level pre-authenticated proxy.
Thank you for any help. Ask any questions if something is unclear.
Using: c++11, Windows 7
EDIT 1: I need to set this programmatically, so please do not suggest any manual actions.
EDIT 2: Partially acceptable is a way how to set proxy programmatically without pre-authentication but still keeping 1. requirement (Not requiring restarting any browser)

System-level proxy settings are located in registry under \Software\Microsoft\Windows\CurrentVersion\Internet Settings hive in HKLM for all users and HKCU hive for current user.
There is an official instruction how to change it via REG file, you does not need to write any code.
But the main problem is: any application may have its own proxy settings, where it 1) can prefer system level settings but allow to override it by user, 2) not using system settings at all.
In corporate environments this problem solves as:
Internet gateway not allowed directly access to external network any computer except proxy server (Microsoft ISA/Forefront Web Proxy)
Proxy settings in registry are forced to all computers via Group Policies
If user need to run application which can not use system-wide proxy settings - it need to install ISA Firewall Client which intercepts all traffic and authenticate it on the ISA proxy.
So when you use full Microsoft software stack - you still not need to write any code :-)
Moreover, ISA Firewall Client uses undocumented Windows features and it will be too hard to write something to replace it with your own "C++11" skills.

Related

I can't change the boot disk when I try to create a Google Cloud Instance

When I try to create a new instance for deep learning on Google Cloud Platform, by following various tutorials including http://cs231n.github.io/gce-tutorial/, I can't select a zone or boot disk (I'd like to use Ubuntu 16.04. There is no response when I click these features. How can I set them?
I've tried to reproduce this issue with various levels of authorisation in my own project and I've not been able to reproduce this issue. As you have access to the Create Instance page, It looks to like this might be a browser specific issue, rather than and issue with authorisation, or any settings within your project.
Would it be possible for you to try and perform this task from a different browser and see if the result is the same? For example, can you try this in Chrome browser and in an Incognito window?
If you are able to perform the action from a different browser, you probably have an issue with cookies, or a third-party browser add on affecting the functionality with GCP. You could try enabling the cookies for the browser to see if that makes a difference, or disabling/removing third party add ons to see if that makes a difference.

Determining browser Proxy setting in NPAPI to download page SSL certificate

Users could have connections through proxies. Some using system-wide proxy settings, others browser-wide proxy.
On Windows for example you could have the system proxy settings as well as proxy settings for Firefox or Chrome alone. Therefore relying on system proxy settings is not reliable.
The only logical solution is to use whatever proxy settings the browser loading my plugin is using. If Firefox is loading my plugin and it has some proxy settings, my plugin should connect using these settings as well. I need my plugin to download the SSL cert of the page in which the plugin is loaded (for further verification..etc).
Is there some way to do that in NPAPI or I must use APIs like Windows WinInet or WinHTTP, or OpenSSL for Linux and Mac? If I have to do so, then how can I let my plugin use whatever proxy settings the host browser is using? I am checking out NPN_GetValueForURL, but I don't think it has good compatibility and good browser interop.
Thank you guys!
I'm pretty sure that NPN_GetURLNotify() will use the browser's proxy settings. It would be pretty crazy if it did not.
Update
If you're writing an NPAPI-based plugin, you need to use the NPN_Get/Post functions to do HTTP requests. That will use the host's proxy settings, cookies, etc. These functions exist for this reason; I don't know why you would use Wininet or roll your own instead.
Looking through about:config, it appears Firefox stores the proxy settings in network.proxy.*. You can access these settings programmatically via the Preferences Service. I suppose you could configure Wininet to behave the same, but you still have the cookie problem.

Is it possible to integrate Kerberos authentication into Jetty 6?

We currently have an application that runs an embedded jetty 6.1.14 server to which we need to add authentication via Kerberos. I'm new to Kerberos, which makes the task about 100x harder that maybe it should be. I've scoured the internet and have found conflicting reports as to whether or not it is even possible but nothing much to provides guidance as to how to proceed.
I've managed to have the server basically be able to authenticate the users via kerberos but can't find away to have the client automatically send its kerberos ticket: I have to use the from auth-method, though there are hints that this may be using filters, which are very poorly documented.
My question - and I apologize for it being a bit vague, I've not been this exasperated in quite a long time - is to request some guidance for plugging in kerberos authentication without login forms in Jetty 6? Or am I just out of luck? Has anyone added this type of authentication to jetty 6?
If Jetty supports Servlet Filters (JSR-53), then this open source project http://spnego.sourceforge.net might be what you are looking for.
You have to prepare your domain environment first. Make sure that your server if part of your domain (joined it). Then you have to create an machine account and assign an SPN. If you have done that, create a keytab for that account. From now on a client will be able to search for the host in the domain and create a ticket for. Then comes Jetty into play.

Yet another elmah problem ... works everywhere but production

I have elmah setup to use SqlErrorLog and this is running fine on both my local using the developer webserver, and my integration environment under IIS. On my production box elmah is able to log exceptions with XmlFileErrorLog writting to the app_data directory. When I switch back to SqlErrorLog I get nadda. I have ensured that the database exists has the required table and three procedures. I have tested the connectionstring. I have compared the web.configs from my local to prod and the only differences are the database server name in the connection strings.
Any thoughts as to what else can be blocking in a production installation?
~-=Mike=-~
Have you properly setup the permissions on the database for ELMAH? Depending on if you are you using impersonation with your web application, you may have to grant privileges to additional users to the stored procedures/tables.

How can I make networking work in my WinCE app without launching IE first?

I have a simple WinCE network application (in C, Win32 APIs). I find that networking doesn't seem to work unless I launch IE (or another network app) first. I assume that IE is setting up my network interface in some way.
How can I do this for myself?
Might I need to display a list of available interfaces to the user (eg. WiFi/Ethernet/3G)?
Thanks.
All I know is that Internet Explorer uses WinInet (wininet.dll) for its networking, and you can too. WinInet is a MS API for working with http and ftp protocols. Many of the settings on the "Internet Options" control panel applet are actually WinInet settings (e.g. for dealing with cookies, setting up proxies on LANs, and autodial on dial-up networks). I'm 99% sure that anything that IE can do, you can do yourself using the API.
I think the answer might be
InternetAttemptConnect
http://msdn.microsoft.com/en-us/library/aa383996(VS.85).aspx
If by "network application" you mean sockets, then WinCE definitely does not require IE to launch for that to work. You'll need to provide more specifics about what you're trying to do for a better answer than that.
You need to establish a network connection first. You can automate the process using the connection manager API:
Connection Manager
The user can also raise a data connection manually.