Arnt 2 days ago

I switched to letsencrypt certs for my imap server. Works well, IMO better than the self-signed ones I used before.

  • hedora 2 days ago

    That adds a lot of attack surface vs. issuing a self-signed cert and confirming it was securely verified by your imap client.

    Not only could let’s encrypt issue a mitm cert for your imap connections, so could other CAs, and any cloud providers / dns providers you use.

    • kelnos a day ago

      Pretty sure most people's threat model doesn't really care about the scenarios you mention. And for most people, that's fine.

      • ho_schi a day ago

        A threat model which people using self-signed certificates especially care about.

        The idea of certificate authorities, certificate chains and intermediary certificates is common - and based on top down security. That is the reason why it is so dangerous. There is a “lock” and people believe everything is “good” but actually DigiNotar, TurkTrust or the bad government issued a certificate. Google tried more than once to improve the situation but I think they just told Chrome only to accept their actual certificates for their services?

        Messenger apps like Signal show how it should be done, the user itself checks and accept. Cameras and QR-codes made it easy. SSHs ASCII fingerprints are a nice thing, too.

        PS: Yep. You shall look at the fingerprint of your chat partners in any messenger app.

    • ehhthing a day ago

      iOS never supported this configuration regardless, a change in SSL certificate does not cause any kind of notification to the user.

      Also, you're basically objecting to the entire idea of PKI for use in IMAP which is incredibly hard to justify. Perhaps you wish to use a different model for your own personal reasons but the default being PKI should not be controversial, and if you want to use your own model you should use a different mail client.

      • detourdog a day ago

        It did support it. One had to trust the certificate manually. I gave up on self-signed cents about 6 years ago.

    • AlphaCharlie a day ago

      How does a self signed cert protect you from MITm if the iPhone will accept any signed certificate thereafter? There’s no cert pinning AFAIK in imaps.

      • xg15 a day ago

        You'd have to manually trust the MITM cert again? Which you certainly would not do as you know you didn't create a new self-signed cert in that moment.

    • commandersaki a day ago

      Uh what is a mitm cert? You're the custodian of the private key associated with the certificate, not LetsEncrypt.

      And any CA can generate a certificate to MITM anything. That's why it's pretty much a requirement to submit all certs issued to Certificate Transparency, and if you're found to be misbehaving expect to receive ire from CA/B.

      • beeflet a day ago

        why should I require some third party's permission to do encryption between one of my computers and another one of my computers?

      • kortilla a day ago

        > Uh what is a mitm cert? You're the custodian of the private key associated with the certificate, not LetsEncrypt.

        Don’t be obtuse. Letsencrypt and every other trusted CA has the ability to issue new certs for any domain at any time without you knowing.

        There is absolutely no requirement to submit these to Certificate Transparency. That’s a thing some browsers do, but not most mail clients.

        If you don’t trust the root CAs at all and only trust your self signed cert or only trust another signing cert you control, then a mitm isn’t possible without getting your private signing cert keys.

  • ytch 2 days ago

    ACME DNS-01 Challenge doesn't need a public resolvable and reachable host, it just sets a temporary DNS record to verify.

  • mmd45 2 days ago

    I'm using a private ip over a vpn so I don't think that workaround will work for me. I don't really want a public dns record.

    • cpach 2 days ago

      If so, then you might want to mint your own root certificate and then import it to your iPhone.

    • Arnt 2 days ago

      LE will issue you a wildcard certificate and it's usable for mail.

      • mmd45 2 days ago

        i'm just using a hardcoded private ip to connect to the imap server. are you saying i can get a certificate with a hostname of "*" that will match ANY ip address?

punnerud 2 days ago

I wish they could break Snapchat, Facebook etcs ‘s self-signed certs. I own the device, why can’t I see the traffic to and from all of these apps if I add my self-signed cert and approve to use a MITM-proxy.

Most apps work, but not everyone.

Often called certificate pinning.

  • tadfisher 2 days ago

    Apple isn't doing certificate pinning, it's the apps verifying the certificate chain themselves by baking in public keys (or hashes/fingerprints). So there's not really a way for Apple to break this.

    • londons_explore 2 days ago

      Apple could say "If you wanna talk HTTPS, you have to use our HTTPSClient class, and that only supports using the system certificate store and does not support pinning".

      Or they could say "All apps that don't support custom certificates for https will be denied app store approval".

      • lxgr 2 days ago

        While you're at it, make sure to have them prohibit any encryption on top of HTTPS, or apps might just be hiding things in application-level encryption schemes!

        Banning certificate pinning... Do we really need mandated insecurity by prohibiting apps from doing better than trusting all Apple-trusted CAs around the world?

      • derefr 2 days ago

        Or you could ignore the self-signed aspect altogether, and instead give the OS VPN framework (where all network introspection stuff lives on iOS) a hook into the forced-choice HTTPS client — a hook that allows the active system VPN to say either “show me that before you encrypt it / after you decrypt it” or “don’t bother encrypting/decrypting that; I’ll handle it.”

        Where, in the latter case, the TLS establishment is opaque, but then the VPN is handed the data that would be going through the TLS logic, plus an (also-opaque) handle to the established TLS-session RSA key, that it can use to finish the encryption/decryption process of each stream-chunk on behalf of the app, after doing whatever filtering / transformation / etc. it wants to do.

        (Anyone remember Privoxy, the “MITM that works for you” that presaged most of the in-client features of Tor Browser? Same idea; just now with OS support.)

      • tadfisher 21 hours ago

        The only way to "not support pinning" is to prevent apps from inspecting the certificate chain. This will break much more than pinning.

      • jesterson a day ago

        Why they would do that? They can't care less about what end user want, particularly in context we are discussing

    • moduspol a day ago

      Actually it depends. Apple does provide a way to configure your app for certificate pinning, which then allows you to pin certificates without any changes in your code. [1]

      Any apps that set up certificate pinning this way could be bypassed by Apple, though obviously there would be little value in them doing it since that'd just lead to app developers doing what you're describing instead.

      Though if I'm understanding this correctly, jailbroken phones could probably bypass it by modifying an app's Info.plist and running the app despite the broken signature.

      [1] https://developer.apple.com/news/?id=g9ejcf8y

    • qingcharles 2 days ago

      Can you not extract the key from the apps? They are only signed against modification, surely? Can you not read the data they have stored on the handset?

      • darknavi 2 days ago

        Generally apps like Fiddler generate their own cert which you load onto the device and accept. My understanding is this allows it intercept and re-write requests. When you do this, apps using cert. pinning will sniff out your "wrong" cert. and stop working.

      • kstrauser 2 days ago

        No, the idea is that the app has the server's public key embedded in them, and they use that to verify that they're connecting only to the server with the corresponding private key.

  • benmmurphy 2 days ago

    If you jailbreak your phone then you are able to remove certificate pinning. If you just want to do this for research purposes then you can buy an old iPhone6s, iPhone8 or iPhoneX and use checkra1n which uses a bug early in the bootchain in order to jailbreak the phone. I think palera1n is based on checkra1n and might have better support for newer iOS versions: https://palera.in/

    • saagarjha a day ago

      No need to jailbreak to remove pinning; you just need to patch the app itself (for example, by replacing the certificate it verifies against or the code that does the verification).

      • benmmurphy a day ago

        you need some way to decrypt the app store app so you know what you are modifying and so you can resign which usually involves a jailbreak. maybe there are these apps that only have the first page encrypted so potentially you don't need to decrypt these apps because you can guess what the first page is.

  • mmd45 2 days ago

    i saw a video on youtube where a guy intercepted https app traffic from an android app for a smart scale where the app used certificate pinning. there was some very automated tool for defeating the cert pinning. unfortunately i can't find the video link.

    • captn3m0 2 days ago

      Probably objection, which uses Frida internally. Unfortunately, it depends on the implementation. It patches Java X509 classes, but some apps don’t use that.

      The biggest pain is Flutter apps, which come with their own native TLS stack.

apparentorder a day ago

I run my own CA and install it as a trusted CA via Configuration Profiles. This works fine, including iOS 17.

Does this break in iOS 18 or does this affect only self-signed (untrusted) certificates?

sgt a day ago

I think I've seen this before, in previous versions of iOS. You used to be able to just force a trust, but it would ask you again sometimes. I ended up just using LetsEncrypt certs, the one I use on the main website. Then I have a hook that also copies it to mailu.

techbrovanguard 2 days ago

tangent, but you can’t send mail on ios with an idn because “the sender address was invalid”, despite it working in macos. i’ve read this is caused by a broken regex check. if any apple employees are reading please take a look

  • schoen a day ago

    Does some other software (like the MUA) need to convert the IDN to punycode before submitting it to the OS?

  • snapetom 2 days ago

    There are so many quirks between the way Mail behaves on iOS vs Mac, its infuriating. At the core of it, if you are manually adding IMAP/SMTP/POP, both just need to get out of the way and stop trying to help. Very typical of Apple to think it knows better than you.

m463 2 days ago

Can you add your own CA cert to your device?

  • urda 2 days ago

    Yes, I have a private CA I install on all my Apple devices for my self-signed certs. After I have the root CA on the device, it looks like any other valid SSL to iOS / macOS.

    • cpach 2 days ago

      Nit-pick: In that case the certs aren’t self-signed, they are regular leaf certs, chained to a “non-standard” CA.

      • urda 2 days ago

        This is true, the user I replied to was asking about root CA's so I tried to address that.

  • lxgr 2 days ago

    You can, but I find that much less secure than being able to TOFU a self-signed certificate:

    I once did this, and besides being incredibly unergonomic, now I have to either securely destroy or safely store the signing key for the self-signed CA, or risk malware from performing an MITM against any app on my device, and not just e.g. the email client.

  • mysteria 2 days ago

    At least with Safari all my internal SSL web services work properly on iOS with the root cert installed. Not sure about IMAP.

stephenmac98 2 days ago

It's 2024, PKI best practices are well known and well documented, anybody still using a self-signed certs on their mail server (or anywhere) is either lazy or stupid.

Plenty of existing applications will refuse to connect to a self-signed certificate on the belief that allowing the end-user to confirm a certificate offers basically 0 protection against malicious actors.

  • shakow 2 days ago

    There is no security hole if I am singing my own certificate for my own mails on my own server; it would mean that I do not trust... myself?

    Now if I were to provide this as a commercial service, sure, my customers may be worried.

    • stephenmac98 2 days ago

      "This is good enough because I don't expect anyone other than me will use it" is lazy

      What would happen if you connected to your mail client today and you got prompted "Trust this certificate?" showing a certificate with the same subject as the one you generated? Most people would click trust and get MITM'ed

      Allowing self signed certificates significantly lowers the bar when it comes to generating a new certificate which can closely resemble an existing certificate

      Beyond that, the management of multiple trusted certificates creates all sorts of room for confusion in an environment. Presumably most services that you run, run over TLS, do you really maintain every certificate both on it's application and on everything which needs to connect to it? That's a huge amount more effort than signing all your PKI with an internal CA, the configuring your connecting applications to trust that CA

      • akira2501 a day ago

        > Most people would click trust and get MITM'ed

        So accept self signed on first connection with a detailed panel showing the certificate fingerprint. Then after that require a more involved process to accept a new certificate.

        > do you really maintain every certificate both on it's application and on everything which needs to connect to it?

        These are client certificates, and in some cases, they're actually pretty awesome.

        > than signing all your PKI with an internal CA

        That's a single layer of abstraction away from a self signed certificate, because, your CA _is_ a self signed certificate in this scenario. You've taken any defense in depth and thrown it right out the window.

        The purpose of software is to make things possible not enforce random pedantry.

      • denkmoon a day ago

        >"This is good enough because I don't expect anyone other than me will use it" is lazy

        is both a mischaracterisation of the argument, and wrong. It's not lazy, it's a choice with pros and cons. Just because you don't like it does not mean it is lazy. Again, issuing your own certificates is a choice.

        Allowing self signed certificates does not "significant lower the bar". Did you know that all root certificates are self signed?

        The management of multiple trusted certificates is basic administration for large private networks. Yes, TLS and certificate management can be complex, but that is not a good argument for disallowing it, and the idea that managing your own certificate trust is against "best practices" is ludicrous.

      • [removed] a day ago
        [deleted]
    • anamexis 2 days ago

      It's not that you're trusting your own certificate, it's that you're trusting any self-signed certificate, leaving you open to getting MITM'ed.

      • denkmoon a day ago

        Why would this oblige the client to trust any self-signed cert as opposed to trusting all certificates whose chain of trust can be established using the system's trust store? The reporter isn't asking for mail to automatically trust untrusted certificates, they have added them to the trust store.

      • darknavi 2 days ago

        Can't you install trusted certificates by hand on iOS?

      • bdavbdav 18 hours ago

        How? You add your signed cert explicitly to the trust store. You’re not just hitting “trust” every time.

    • cpach a day ago

      Please keep in mind that a self-signed certificate is quite different from a certificate that is signed using a private CA.

      The self-signed certificate has no link to a trust anchor. So it’s easy for Mallory to replace it with her own malicious certificate. It’s much harder for Mallory to replace a certificate that is tied to a CA.

  • kortilla a day ago

    It’s 2024, we’ve seen countless examples of sophisticated hackers getting into all kinds of systems. Anybody who makes a blanket statement that you have to trust the public PKI is either lazy or stupid.

    SSH has TOFU and it works very well if you don’t want a key infrastructure.

  • mmd45 2 days ago

    explain how a pinned self signed cert is insecure. i don't see it. it would seem to be more secure than one signed by a public CA that's not pinned.

    • stephenmac98 2 days ago

      I didn't say a "pinned self signed cert is insecure"

      I said that self-signed certs are a lazy choice

      I also said "allowing the end-user to confirm a certificate offers basically 0 protection" If an average user get's prompted to trust a certificate they will do so blindly At most, someone might look at the subject, but it's 0 effort for a malicious actor to generate a self-signed cert with the same subject, which will be sufficient to fool a decent chunk of users

      Pinned certificates do relieve the above issue, but it is still a lazy choice that creates increased long term complexity in the configuration of multi-system environments Presumably most services that you run, run over TLS, do you really maintain every certificate both on it's application and on everything which needs to connect to it? That's a huge amount more effort than signing all your PKI with an internal CA, the configuring your connecting applications to trust that CA Using a CA also allows for use of CRLs or OCPS. If you have 20 devices configured to trust a given self-signed certificate, and that certificate leaks, you now have to update all 20 devices to remove that trust. If you used a CA and implemented either a CRL or OCSP, then you only have to update the respective impelmentation and all of yoru clients will immediately stop trusting that certificate.

      In Summary: Using an internal CA offers all the potential protections of pinned certificate, with a number of additional useful security options like OCSP or CRLs Using Self signed certificates creates more work when handling certificate leaks or certificate rotation Using a CA is the industry standard practice, I highly doubt there is a single outward facing project by a major company using a directly self-signed certificate. BUT A self signed certificate is lower effort on the initial setup

      Lazy

      • kortilla a day ago

        You need to calm down and take a step back to realize not everyone needs to support 20 devices or even 2. What you’ve suggested is a ridiculous blanket statement assuming everyone is setting up things for a fleet of clients.

      • mmd45 2 days ago

        for the use case of a single user IMAP server this is all way, way, too complicated and buys you nothing in terms of security. it's completely analogous to why we dont use CAs to validate openssh host certificates.

        • Twisell a day ago

          Yes it's a analogous using CA is still a higher bar, but it would arguably be better to also use CA to validate openssh host certificates for all the reasons he listed above.

          So maybe we should ask ourselves why can't we just figure out a way to improve handling of CA? Thanks to Let's Encrypt https coverage dramatically improved, now is maybe the time for more people to switch to self CA.

          I agree though that promoting adoption through good tooling and pedagogy would be a nicer approach than Apple slap on the wrist.

    • lxgr 2 days ago

      It really only is for bad practical reasons, that all coincidentally make it harder and harder to self-host stuff locally without paying a few dollars a month or year here and there to various rent seekers.

      "Just use Letsencrypt" really is the correct answer for 99% of use cases, but good luck if you find yourself with one from the 1%. You'll get an army of people mindlessly parroting "best practices" and will assume you're incompetent/lazy if you can't find a way to make them work for you.

      • User11110 2 days ago

        Internal CAs and self signed certificates are different. You can still generate a CA, sign your certificates, import your own CA into your phone and have that verify your certificates. You don't need Letsencrypt. But you'll learn in time.

  • lxgr 2 days ago

    Or is operating a local-only mailserver not connected to the larger internet? I guess that's a lazy or stupid thing too, these days...

    I'm a fan of having TLS on by default for everything on the Internet, but I'm seriously annoyed by the collateral damage to local self-hosted services the implementation of that has caused.

    It shouldn't be this hard to e.g. host web server on my local network that browsers grace with "trusted website APIs", but it really is. Why on earth do I need to set up Letsencrypt (and by extension at least DNS) on a local website if I want to be able to use a game pad on it, for example!? https://developer.mozilla.org/en-US/docs/Web/Security/Secure...

    We absolutely need a localhost and local domain exemption for both TLS/X.509 certificate validation and web APIs. For example, TOFU seems like a much better model for that use case than trying to bend the "public Internet" model until it fits. SSH has had considerable success in that model, for example.

    • stephenmac98 2 days ago

      You have to consider the rarity of your use case vs the use case they're defending against.

      How often do you think someone tries to connect their gamepad to a local server? Not never, but the total amount of users doing it is probably high tens or low hundreds at most

      Compare that to how often gamepad users try to connect to a malicious website - probably hundreds or ever thousands of times a day.

      Loosening certificate validation further expose the many less than competent users to risk, and the potential impact both on the customer base and on the product's reputation are significantly higher than the risks of making it cost a couple bucks a year to allow your gamepad to connect to a local server.

      For something like a computer, there is a legitimate argument for allowing the user to bypass SSL/TLS restrictions (after some resistance) because laptops are used for development.

      I can almost guarantee that the gamepad developers had an options for certificate validation bypass in it's developer options, but they're not gonna expose that needlessly when it offers no benefit, but exposes their customers to additional risk. Your gamepad is likely not a development device after all

      • lxgr 2 days ago

        Any malicious website can access my gamepad, since it can trivially get a Letsencrypt certificate – the only requirement for getting "secure origin" API access.

        What exactly is this restriction preventing me from, then? (And what does a malicious website do with my gamepad data anyway?)

        > Not never, but the total amount of users doing it is probably high tens or low hundreds at most

        Yes, I'm fully aware that local hosting is rare in the grand scheme of things, but I think you're vastly underestimating the potential. It's currently not even possible to do much better even as a commercial NAS provider, and these are somewhat popular.

        A big part of that also seems like a chicken and egg problem: Fewer and fewer users do it because it's getting harder and harder, thanks to browser standards and OS defaults being largely driven by stakeholders that have no interest in it becoming easier.

        Yes, none of this is an evil conspiracy; it's just a question of incentives and priorities in the end. I just find it so sad how willingly even a "hacker" audience here embraces the move towards more and more centralization, on more than one dimension. (Peer-to-peer vs. client-to-server, "trusted CA only" vs. trust on first use, cloud vs. self-hosting etc.)

    • diogocp 2 days ago

      > We absolutely need a localhost and local domain exemption for both TLS/X.509 certificate validation and web APIs.

      localhost is already considered a secure origin.

      Local networks are horribly insecure; easily the most likely place for a MITM attack.

      • lxgr 2 days ago

        Ah, that’s good – it’s been a while since I last had to work around that.

        And I generally agree on local networks being insecure. So how about making them more secure instead of marginalizing them even more?

        TOFU for TLS certs on .local (for Zeroconf, and maybe something else/new for local DNS) would be a huge step forward from unencrypted and unauthenticated HTTP. Such sites could even still be displayed with a broken padlock or whatever HTTP gets these days to not create any false expectations by users.

walrus01 2 days ago

I think the solution to this is to:

a) run your own private root CA

b) install the public part of the root CA on your device and trust it (basically the same as many major enterprise end users of android and ios devices need to do already, so this functionality is extremely unlikely to be removed from the operating system)

c) use the root CA to sign a cert for your mail server

Yes it's a bit more hassle than just trying to tell the mail client to trust your self-signed cert that was generated on the mail server and signed by nothing, but I can understand why apple (given the population of hundreds of millions of NON TECHNICAL end users) doesn't want people just blindly clicking through "yes/I accept/trust this server" self signed cert warnings.

xg15 a day ago

And the Apple fanboys are loose again...

Regardless how your opinion on PKI and self-signed certificates is, shouldn't we at least be bothered by the fact that Apple just switched off this feature without any communication whatsoever? The community was literally in the dark about whether this is an official policy change or a bug.

Google, in situations like this, at least made some corpospeak press release officially "sunsetting" the feature and provided an official deprecation timeline so users have time to adapt.

Apple is apparently just leaving their users stranded and unable to access their email.

  • ben_w a day ago

    I suspect it's worse than that.

    Since the UK's Investigatory Powers Act 2016, I've noted that every web browser is necessarily an end-to-end encrypted communication system.

    This isn't compatible with what all the spy agencies want. The US can kinda get past that with the reporting obligation for anyone publishing on an app store controlled by a US company. (As a British citizen living in Berlin, the corresponding checkbox when publishing apps is mildly infuriating).

    Now that Apple is obligated to allow competitors, that doesn't work. Or perhaps the agencies finally noticed that this problem applies to websites and not just apps (perhaps web apps are finally good enough?)

    So the agencies find another way — and this time it comes with an obligation to not report what they're doing.

    This smells like that other way.

    Might not be correct, but intelligence agencies' long-standing history means it's not paranoia.

tiberious726 2 days ago

Does anyone know if there is any way to get iOS's mail client to present a client cert? Or, barring that, any form of self-hosted MFA.

mmd45 2 days ago

:-(

hey lurking apple devs- can someone please escalate this?

  • cpach 2 days ago

    I would not bet money that Apple is willing to change their mind regarding this question.

    • mmd45 2 days ago

      per apple dev forums it seems like they have a history of breaking this and then fixing it. additionally, while IMAP is broken, calendars and notes seem to work just fine so hopefully it's not deliberate.

    • [removed] 2 days ago
      [deleted]
[removed] 2 days ago
[deleted]
yieldcrv a day ago

I feel like this going to happen to the permissionless side of crypto assets just like whats happened to most of the web 1.0 stuff

Walled garden things will take over and something is going to happen to EOAs that make them nerfed or rare

but at the same time, that might take 40 years just like these web 1.0 problems so its fine for now

[removed] a day ago
[deleted]
nerdile 2 days ago

So in summary: iOS used to accept untrusted certificates, yikes! Now, it validates the server cert, and people are upset? This blatantly insecure thing is broken now and the posters don't want to set it up securely?

It seems like these people are just struggling with how to properly set up their email server and clients when using a private CA. If you're going to use your own CA, then configure your client to trust it. The rest of us should be able to enjoy secure defaults and not have to worry about our less informed family members being tricked into bypassing basic security protections like TLS validation.

  • mmd45 2 days ago

    bad summary. it prompted you to accept the certificate upon first use and then pinned it which is far different than what you are describing in terms of security implications.

    • nerdile a day ago

      TOFU for invalid/untrusted certificates is the equivalent of "go there anyway" in a browser Very different than explicitly trusting a Private CA. It means that skilled attackers can rely on unskilled users clicking the "trust me, it's fine" button. All so that someone skilled enough to set up their own email server and certificates doesn't have to configure their system securely?

      This is about making bad things harder for unskilled users at the cost of raising the standard for service providers. If you can set up an email server, you can use easyrsa or step-ca or some manual openssl to create your own root CA. Or, register your self-signed email server as a trusted root CA.

      Personally, I use easyrsa for my internal CA (with domain path constraints because I'm paranoid) and letsencrypt for my mail server, but I require VPN access to the user ports on the mail server.

      • mmd45 a day ago

        you are assuming i have users and this is a mail server not a website which has a very different access pattern more analogous to ssh where TOFU works beautifully.