Pergunta

I try to get mail through the IMAP protocol from my corporative email with this code:

MCOIMAPSession *session = [[MCOIMAPSession alloc] init];
[session setHostname:@"imap.mymail.com"];
[session setPort:993];
[session setUsername:@"accidbright@mymail.com"];
[session setPassword:@"password"];
[session setConnectionType:MCOConnectionTypeTLS];
MCOIMAPFetchMessagesOperation * fetchOperation = [session fetchMessagesByUIDOperationWithFolder:inboxFolder requestKind:MCOIMAPMessagesRequestKindHeaders uids:searchResult];
[fetchOperation start:^(NSError *error, NSArray *messages, MCOIndexSet *vanished) {
    if (error) {
        NSLog(@"Fetching all the message subjects error: %@!", error);
    } else {
        NSLog(@"Fetched all the messages subjects!");
    }
}];

And I get error:

Fetching all the message subjects error: Error Domain=MCOErrorDomain Code=4 
"The certificate for this server is invalid." UserInfo=0x7889ab0 
{NSLocalizedDescription=The certificate for this server is invalid.}!

I know, that our mail is signed with domain certificate, so outside the domain it is unverified certificate. But almost all applications, that work with mail (f.e. Mac Mail), has button "Continue" and this allow to skip certificate verification and work with mailbox. So I interest is there any possibility to do this in MailCore 2? If yes, how can I do this?

By the way, when I used MailCore, I hadn't such problem.

Foi útil?

Solução

You should really open an issue on MailCore 2's GitHub page. Try:

[session setCheckCertificateEnabled:NO];
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top