Q:

Is "ssl : true" a valid option to connect to a mysql server using ssl

I currently use the mysql module with the following code to connect to my server:
var connection = mysql.createConnection({
  host : 'db1.domain.tld',
  user : 'username',
  password : 'xxxxxx',
  ssl : true
});

And this works without any problems, but out of the documentation it is not clear that this is even valid. There they write:

SSL options
  The ssl option in the connection options takes a string or an object. When given a string, it uses one of the predefined SSL profiles included.

So base on that description ssl : true would not be valid. So my question is, if this is a valid option, and why? 

A:

Investigating the source code the behaviour of
var connection = mysql.createConnection({
  host : 'db1.domain.tld',
  user : 'username',
  password : 'xxxxxx',
  ssl : true
});

Will be equal to write:
var connection = mysql.createConnection({
  host : 'db1.domain.tld',
  user : 'username',
  password : 'xxxxxx',
  ssl : {
     rejectUnauthorized: false
  }
});

The reason for this is because of this part of the code in ConnectionConfig.js:
if (this.ssl) {
  // Default rejectUnauthorized to true
  this.ssl.rejectUnauthorized = this.ssl.rejectUnauthorized !== false;
}

Because this.ssl holds a boolean in the given case, the this.ssl.rejectUnauthorized = ... does nothing and this.ssl.rejectUnauthorized will be undefined after that if.
Because undefined is a falsy value, it will behave the same way as if rejectUnauthorized is set to false. So it would use ssl but it would not reject an invalid certificate.
As of that setting ssl to a boolean is not valid, or at least will result in an unexpected behaviour.

