Welcome to the Microsoft Windows Vista Community Forums - Vistaheads, YOUR Largest Resource for Windows Vista related information.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so , join our community today!
If you have any problems with the registration process or your account login, please contact us.
|
|
|
InternetGetCertByURL always returns FALSE
microsoft.public.internetexplorer.general
|
|

11-12-2009
|
|
|
|
InternetGetCertByURL always returns FALSE
Hi,
I would like to access the information of the security certificate of the
current page from within an Internet Explorer add-on and found the
undocumented function:
INTERNETAPI_(BOOL) InternetGetCertByURL(LPCWSTR lpszURL,LPWSTR
lpszCertText,DWORD dwcbCertText);
Unfortunately, the function returns always FALSE on IE6 and IE8.
Does anybody know how to get the certificate data in Internet Explorer?
best regards,
Viktor Krammer
--
http://www.quero.at/
The New Web Experience
|
|

11-12-2009
|
|
|
|
Re: InternetGetCertByURL always returns FALSE
Hi Viktor,
Did you see this thread in the wininet PNG?
http://www.tech-archive.net/Archive/.../msg00112.html
Regards.
"Viktor Krammer" <support@quero_no_spam.at> wrote in message
news:ut$2jL9YKHA.5144@TK2MSFTNGP05.phx.gbl...
> Hi,
>
> I would like to access the information of the security certificate of the
> current page from within an Internet Explorer add-on and found the
> undocumented function:
>
> INTERNETAPI_(BOOL) InternetGetCertByURL(LPCWSTR lpszURL,LPWSTR
> lpszCertText,DWORD dwcbCertText);
>
> Unfortunately, the function returns always FALSE on IE6 and IE8.
>
> Does anybody know how to get the certificate data in Internet Explorer?
>
> best regards,
>
> Viktor Krammer
> --
> http://www.quero.at/
> The New Web Experience
>
|
|

11-12-2009
|
|
|
|
Re: InternetGetCertByURL always returns FALSE
Hi rob,
yes, I have read that thread, but it seems that nobody was ever able to use
that function?
best regards,
Viktor Krammer
--
http://www.quero.at/
The New Web Experience
|
|

11-12-2009
|
|
|
|
Re: InternetGetCertByURL always returns FALSE
Viktor Krammer <support@quero_no_spam.at> wrote:
> I would like to access the information of the security certificate of
> the current page from within an Internet Explorer add-on and found the
> undocumented function:
>
> INTERNETAPI_(BOOL) InternetGetCertByURL(LPCWSTR lpszURL,LPWSTR
> lpszCertText,DWORD dwcbCertText);
>
> Unfortunately, the function returns always FALSE on IE6 and IE8.
Since IE6, InternetGetCertByURL is just a stub. If you step through the disassembly, it returns FALSE right away.
> Does anybody know how to get the certificate data in Internet
> Explorer?
Not easily. The only way I know of is to actually intercept all HTTP requests, e.g. by using my Passthrough APP. While the request is in progress, you can use InternetQueryOption (or IWinInetInfo::QueryOption) with INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT flag.
Or, I suppose, you could send another request to the same server in the background, and obtain the certificate this way.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925
|
|

11-13-2009
|
|
|
|
Re: InternetGetCertByURL always returns FALSE
Hi Igor,
Thanks for your info.
>Or, I suppose, you could send another request to the same server in the
>background, and obtain the certificate this way.
I also had that idea just some moments ago :-)
I have played a bit with InternetQueryOption &
INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT.
The problem is that it returns the certificate subject just in a flat
string, and does not retain the name, value pairs such as O=organization
name.
Do you know how to get the raw subject info from a certificate?
Best regards,
Viktor Krammer
--
http://www.quero.at/
The New Web Experience
|
|

11-13-2009
|
|
|
|
Re: InternetGetCertByURL always returns FALSE
Viktor,
OT, but -- still using quero with XP-SP3, IE8. Great combination!
Many thanks
================================================== ====
"Viktor Krammer" <support@quero_no_spam.at> wrote in message
news:eI5zkH$YKHA.5144@TK2MSFTNGP05.phx.gbl...
Hi Igor,
Thanks for your info.
>Or, I suppose, you could send another request to the same server in the
>background, and obtain the certificate this way.
I also had that idea just some moments ago :-)
I have played a bit with InternetQueryOption &
INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT.
The problem is that it returns the certificate subject just in a flat
string, and does not retain the name, value pairs such as O=organization
name.
Do you know how to get the raw subject info from a certificate?
Best regards,
Viktor Krammer
--
http://www.quero.at/
The New Web Experience
|
|

11-13-2009
|
|
|
|
Re: InternetGetCertByURL always returns FALSE
Viktor Krammer wrote:
> I have played a bit with InternetQueryOption &
> INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT.
>
> The problem is that it returns the certificate subject just in a flat
> string, and does not retain the name, value pairs such as O=organization
> name.
>
> Do you know how to get the raw subject info from a certificate?
Not with WinInet, to the best of my knowledge. You could try with WinHttp - see in particular WINHTTP_OPTION_SERVER_CERT_CONTEXT flag for WinHttpQueryOption. This gives you CERT_CONTEXT, which you can then interrogate using CryptoAPI.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925
|
|

11-13-2009
|
|
|
|
Re: InternetGetCertByURL always returns FALSE
Hi Igor,
Thanks for your suggestion, WinHttp looks promising to get to the desired
info. I will look into that.
Best regards,
Viktor Krammer
--
http://www.quero.at/
The New Web Experience
|
|

11-13-2009
|
|
|
|
Re: InternetGetCertByURL always returns FALSE
Hi bobster,
> OT, but -- still using quero with XP-SP3, IE8. Great combination!
thanks, exepct the next update soon ;-)
Viktor Krammer
--
http://www.quero.at/
The New Web Experience
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| My windows is false ? |
Emil |
microsoft.public.windows.vista.mail |
3 |
07-01-2009 23:06 |
| False alarm! |
Steve |
Security News |
0 |
05-20-2008 23:50 |
| False Positives |
saxonpig |
microsoft.public.windows.vista.general |
2 |
08-23-2007 14:22 |
| False MVP |
Antonio Amengual |
microsoft.public.windows.vista.general |
16 |
04-30-2007 02:33 |
| False infections? |
Danny |
microsoft.public.windows.vista.general |
5 |
02-28-2007 23:22 |
All times are GMT +1. The time now is 10:18.
|
|