Microsoft Windows Vista Community Forums - Vistaheads
Recommended Download



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.

Driver Scanner

InternetGetCertByURL always returns FALSE

microsoft.public.internetexplorer.general






Speedup My PC
Reply
  #1 (permalink)  
Old 11-12-2009
Viktor Krammer
 

Posts: n/a
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

Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-12-2009
rob^_^
 

Posts: n/a
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
>

Reply With Quote
  #3 (permalink)  
Old 11-12-2009
Viktor Krammer
 

Posts: n/a
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

Reply With Quote
  #4 (permalink)  
Old 11-12-2009
Igor Tandetnik
 

Posts: n/a
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

Reply With Quote
  #5 (permalink)  
Old 11-13-2009
Viktor Krammer
 

Posts: n/a
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

Reply With Quote
  #6 (permalink)  
Old 11-13-2009
bobster
 

Posts: n/a
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


Reply With Quote
  #7 (permalink)  
Old 11-13-2009
Igor Tandetnik
 

Posts: n/a
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
Reply With Quote
  #8 (permalink)  
Old 11-13-2009
Viktor Krammer
 

Posts: n/a
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

Reply With Quote
  #9 (permalink)  
Old 11-13-2009
Viktor Krammer
 

Posts: n/a
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

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
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 04:03.




Driver Scanner - Free Scan Now

Vistaheads.com is part of the Heads Network. See also XPHeads.com , Win7Heads.com and Win8Heads.com.


Design by Vjacheslav Trushkin for phpBBStyles.com.
Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.0 RC 2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120