Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72092 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88852 invoked from network); 3 Feb 2014 18:08:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Feb 2014 18:08:32 -0000 Authentication-Results: pb1.pair.com header.from=rdlowrey@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rdlowrey@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.177 as permitted sender) X-PHP-List-Original-Sender: rdlowrey@gmail.com X-Host-Fingerprint: 209.85.223.177 mail-ie0-f177.google.com Received: from [209.85.223.177] ([209.85.223.177:64811] helo=mail-ie0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3C/B8-35654-D1BDFE25 for ; Mon, 03 Feb 2014 13:08:29 -0500 Received: by mail-ie0-f177.google.com with SMTP id at1so6494951iec.22 for ; Mon, 03 Feb 2014 10:08:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=29zOKCfDLyvd9Zlo6GA5i9kh3E0x/2K5eULFYVPc4l0=; b=eJvGmCo97CC1EtMn82VppUxmqkinx75Bd0gvoZJ4K7P2aDC2jbKBnltkYO1kdv9tuK bthQ0iWerM6lm9Wp5zmOVTlkvVGKyvyjhvnMUAnx1CMPG8mZVJUycPSfJI2AxRJ2JDhP KrhR2FrXPspiCfAESqRpBxGLvd7cMrfPnVjCtB2pC9DtfmYQYghcPQYHSK6DSpmOl40L zo0s0jC/ljjS83SweRl+GoaWia3XWAc+HrCFAptKqZ3XQ7mwGC/EMGjbiquImB+W0PB/ RHOtzGs3O42H9O4hd7QicnL53dwse6/mAzRu1CJUuGW1hOvffzh6wHvkNJN5xVY5PCv7 sOzQ== MIME-Version: 1.0 X-Received: by 10.50.60.105 with SMTP id g9mr13306600igr.14.1391450906294; Mon, 03 Feb 2014 10:08:26 -0800 (PST) Received: by 10.50.29.140 with HTTP; Mon, 3 Feb 2014 10:08:26 -0800 (PST) Date: Mon, 3 Feb 2014 13:08:26 -0500 Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=047d7b10caa5fdfde004f18468ba Subject: Windows Peer Verification From: rdlowrey@gmail.com (Daniel Lowrey) --047d7b10caa5fdfde004f18468ba Content-Type: text/plain; charset=ISO-8859-1 I was playing with the most recent snap builds and, as expected, the openssl delegation to OS maintained certificate stores does not work in windows (like it does everywhere else). In sane distros we're able to take advantage of the OS-managed cert stores without getting our hands dirty. However, windows uses a different certificate format which first requires conversion to .PEM for use with OpenSSL libs. It *is* possible to load certs from the windows store at runtime and perform the conversion, however I'm unfamiliar with the relevant APIs for interfacing with the windows cert store and wouldn't feel comfortable implementing in the remaining pre-5.6 time-frame. Further, this wouldn't be a particularly good solution for web environments where we'd be duplicating all the certificate conversion work in each request (as needed) if we rely on the OS to keep certificates current. We could generate the converted certs in PEM format once, but then you basically lose the benefits of updates courtesy of the OS when you do that. The options for dealing with this (as I see them) are: 1. Disable peer-verification by default in windows builds. Personally, I don't see this as a valid option as it's terrifically insecure. I believe it's better to fail with a warning than allow users to believe they're conducting safe transfers when they're 100% vulnerable to Man-in-the-Middle attacks. 2. Do nothing and document heavily. Peer verification failures will already generate an informative error message. Beyond this, the steps required by a windows user to make peer verification work by default are extremely simple: - Download this file: http://curl.haxx.se/ca/cacert.pem (or equivalent) - openssl.cafile = C:/path/to/cacert.pem (in php.ini) Also, we could easily generate a painfully explicit E_WARNING in windows explaining exactly how to fix the problem in the absence of the requisite configuration. 3. Include the same PEM-formatted CA file curl distributes with windows PHP binaries and pre-populate the relevant php.ini directive. I don't *think* this would come with any licensing issues as the curl cacert file is licensed under the same licenses as the Mozilla source file it draws from (MPL 1.1, GPL v2.0 or LGPL 2.1). However, I'm not an expert in these matters, so others would likely need to comment. Obviously, we want to avoid a 5.6 release with confused/upset Windows users whose https:// transfers no longer work as before. However, the simple fact is that the code that worked previously shouldn't have worked as it was a massive security problem. I don't want people to feel like the original peer verification RFC was a misrepresentation, so if necessary we can vote on exactly how to handle the situation re: windows users in 5.6. Thoughts? --047d7b10caa5fdfde004f18468ba--