Skip to content

DoH: some options from user's transfer are not properly inherited #4578

Description

@3dyd

Take a look at these lines from dohprobe:

curl/lib/doh.c

Lines 277 to 282 in 8063c32

/* Inherit *some* SSL options from the user's transfer. This is a
best-guess as to which options are needed for compatibility. #3661 */
if(data->set.ssl.falsestart)
ERROR_CHECK_SETOPT(CURLOPT_SSL_FALSESTART, 1L);
if(data->set.ssl.primary.verifyhost)
ERROR_CHECK_SETOPT(CURLOPT_SSL_VERIFYHOST, 2L);

If data->set.ssl.primary.verifyhost is set to zero, appropriate option in DoH handle stays untouched. But its default value is 2. I.e. currently you cannot disable certificate's name verification for DoH request.

Not sure if this is intended behavior. And if it is, at least the comment is a bit misleading.

Affected options (whose default value is not zero):

  • CURLOPT_SSL_VERIFYHOST
  • CURLOPT_PROXY_SSL_VERIFYHOST
  • CURLOPT_SSL_VERIFYPEER
  • CURLOPT_PROXY_SSL_VERIFYPEER
  • + any used option whose default value would change in future.

Similar concern for the code constructions like the following one:

if(data->set.ssl.falsestart)
  ERROR_CHECK_SETOPT(CURLOPT_SSL_FALSESTART, 1L);

(Not sure though if this may generally happen in the library but) If option (falsestart in this case) would be expanded in further library versions (get more values than '0' or '1') then code like this will need to be revisited what is easy to overlook.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions