Thanks @eskimo for the valuable links. I went through them. But as I have mentioned, my query is when I remove kSecAttrProtocol constraint, I get the below output as one the attribute in result ref.
kSecAttrProtocol : htpx
But when I add that in constraint, I recieve item not found.
NSString *account = @"user";
NSString *server = @"w.x.y.z";
SecProtocolType protocol = kSecProtocolTypeHTTPProxy;
NSDictionary *query = @{
(__bridge id)kSecClass: (__bridge id)kSecClassInternetPassword,
(__bridge id)kSecAttrAccount: account,
(__bridge id)kSecAttrServer: server,
(__bridge id)kSecAttrProtocol:@(protocol),
(__bridge id)kSecReturnAttributes: (__bridge id)kCFBooleanTrue,
(__bridge id)kSecReturnData: (__bridge id)kCFBooleanFalse,
(__bridge id)kSecMatchLimit: (__bridge id)kSecMatchLimitOne
};
CFDictionaryRef result = NULL;
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, (CFTypeRef *)&result);
if (status == errSecSuccess) {
NSDictionary *passwordItem = CFBridgingRelease(result);
NSLog(@"Internet Password Item Found:");
} else if (status == errSecItemNotFound) {
NSLog(@"Internet Password Item Not Found");
} else {
NSLog(@"Error retrieving Internet password: %d (%@)", (int)status, CFBridgingRelease(SecCopyErrorMessageString(status, NULL)));
}