I am using below code in my program. Initial query function returns flags value as 256(unknown CA) error. I have used this line "Flags &= ~SECURITY_FLAG_IGNORE_UNKNOWN_CA;" to remove the unknown CA value from flag and passed the value to internetsetoption function. This internetsetoption function doesnt throw any error and also fuction also not successful. Final query function also returns same value 256 instead of giving value as 0
Can you please clarify why the flag value is not set when is used set function?
Code:
uint32 Flags=0;
uint32 Flags_test=0;
uint32 Length = sizeof(Flags);
if (!InternetQueryOption(Handle, INTERNET_OPTION_SECURITY_FLAGS, &Flags,&Length))
{
if any erro logged here
}
Flags &= ~SECURITY_FLAG_IGNORE_UNKNOWN_CA;
if (!InternetSetOption(Handle, INTERNET_OPTION_SECURITY_FLAGS, &Flags, sizeof(uint32)))
{
if any erro logged here
}
if (!InternetQueryOption(Handle, INTERNET_OPTION_SECURITY_FLAGS, &Flags,&Length))
{
if any erro logged here
}