Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63613 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64406 invoked from network); 25 Oct 2012 06:21:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Oct 2012 06:21:04 -0000 Authentication-Results: pb1.pair.com smtp.mail=theanomaly.is@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=theanomaly.is@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.42 as permitted sender) X-PHP-List-Original-Sender: theanomaly.is@gmail.com X-Host-Fingerprint: 209.85.215.42 mail-la0-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:58513] helo=mail-la0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BB/A0-59506-F4AD8805 for ; Thu, 25 Oct 2012 02:21:04 -0400 Received: by mail-la0-f42.google.com with SMTP id e6so1124715lah.29 for ; Wed, 24 Oct 2012 23:21:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=N+YSnnlqrjfiqbaX443o7xOtFoEnBz6Aw1IwLX3SA+w=; b=DEecqBCQFMaVy6hMZ37uR5jRFZYRKsh4JMIXCEuFPRLFouH5O2/QpHPqN0YAC3oCOk xkzV7qVw4NqxtGTC7opDT0HxrjgCrQ8WdPeZlGuzflI6FUrRB57LQZnamrQ8kCWrKTVQ 8uvlef8O2oZYzoeXqWtZV35DUBIznXBMcc4yOFcTWHTxB2eGjPVWRKrb3ocmqhN7pPQM rNpo8cu6ySUq3MyGssGfOkA9uJqBPePjbScgJX5Hxo5jlgVHItSF/5NpnOr4V/GY5Yar vSEOHsXmSu6+7bHONN9NQxaj1Pdiw4bcPYo5ilLgmtMnAbLKMWI/4O9AJM9xKJRnzitp 7w9A== MIME-Version: 1.0 Received: by 10.112.25.168 with SMTP id d8mr7191129lbg.61.1351146060996; Wed, 24 Oct 2012 23:21:00 -0700 (PDT) Received: by 10.112.102.231 with HTTP; Wed, 24 Oct 2012 23:21:00 -0700 (PDT) In-Reply-To: References: Date: Thu, 25 Oct 2012 02:21:00 -0400 Message-ID: To: JJ Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Changing the default value of "true" for CURLOPT_SSL_VERIFYHOST From: theanomaly.is@gmail.com (Sherif Ramadan) On Thu, Oct 25, 2012 at 1:46 AM, JJ wrote: > On Wed, Oct 24, 2012 at 10:34 PM, Sherif Ramadan > wrote: >> I understand there are people out there that don't read the >> documentation and aren't aware of the difference between >> curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); and curl_setopt($ch, >> CURLOPT_SSL_VERIFYHOST, true); but still... I don't think this is a >> good idea either. > > I highly doubt code that sets CURLOPT_SSL_VERIFYHOST => true meant to > imply CURLOPT_SSL_VERIFYHOST => 1...which essentially bypasses host > verification. That's not our place to start guessing what the user did or did not intend. The fact remains that a cast of a boolean true to int is in fact 1. The fact also remains that CURLOPT_SSL_VERIFYHOST expects an int as per the documented behavior. The fact additionally remains that no user would expect var_dump((int) true) to return int(2). > > According to libcurl, CURLOPT_SSL_VERIFYHOST => 1 is "not ordinarily a > useful setting". > Again, you're confusing users who don't read documentation and/or don't understand it with users who may have fully read documentation and understood it perfectly well and ever intention of setting CURLOPT_SSL_VERIFYHOST to 1. I understand your intentions here are good, but we should not be magically trying to guess what the user wants. We should document the behavior clearly and this solution makes documentation completely unclear. Nowhere in the PHP manual do we say "we might break the promise of a boolean cast to int and make it int(2) instead of int(1)". > - JJ