Re: Encryption with OpenSSL/GnuTLS

Marc Abramowitz <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <CAAgNOZ1udX3+HOONRMXjp-c5CB4pJXvNrWSt5b=HOLPpS98Caw@mail.gmail.com>
I think I just found the problem. Two problems, actually, in my opinion.

```
marca@marca-mac:~/dev/git-repos/freetds$ ag TDS_STR_ENCRYPTION_REQUIRE
include/freetds/tds.h
507:#define TDS_STR_ENCRYPTION_REQUIRE "require"
marca@marca-mac:~/dev/git-repos/freetds$ ag 'means create and allow'
doc/userguide.sgml
1041:                                                        <entry>Specify
if encryption is desidered. Supported for Microsoft servers. <symbol>off</>
disables encryption (only if needed); <symbol>request</> means use if
available; <symbol>required</> means create and allow encrypted connections
only.</entry>
```

Note that the setting in freetds.conf is "require" and the documentation
says that it's "required" (with a "d" at the end). Oops.

If I specify "encryption = require" in freetds.conf, the connection IS
encrypted according to sys.dm_exec_connections

So the incorrect documentation of the encryption setting is the first
problem.

Merge request to correct the userguide:
https://gitorious.org/freetds/freetds/merge_requests/9

Unfortunately if you specify an illegal setting, FreeTDS logs an error, but
you might not notice it if you don't have TDSDUMP set.

```
marca@marca-mac:~/dev/git-repos/pymssql$ TDSDUMPCONFIG=stdout tsql -S vm -U
user -P password | grep UNRECOGNIZED
config.c:455:UNRECOGNIZED option value 'required'...ignoring.

marca@marca-mac:~/dev/git-repos/pymssql$ tsql -S vm -U user -P password
locale is "en_US.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
1>
```

This is the second problem. I think that this should be a fatal error since
it can lead people to think they're using encryption when they're not.

Merge request to make an invalid encryption setting a fatal error:
https://gitorious.org/freetds/freetds/merge_requests/10

With this, you get a fatal error for an incorrect encryption setting:

```
marca@marca-mac:~/dev/git-repos/pymssql$ tsql -S vm -U user -P password
config.c:456: UNRECOGNIZED option value 'required' for 'encryption' setting!
Valid settings are: ('off', 'request', 'require')
```

Marc
http://marc-abramowitz.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.