|
16 | 16 | * See the License for the specific language governing permissions and |
17 | 17 | * limitations under the License. |
18 | 18 | */ |
19 | | - |
20 | | -import WebSocketChannel from "./ch-websocket"; |
21 | | -import NodeChannel from "./ch-node"; |
| 19 | +import WebSocketChannel from './ch-websocket'; |
| 20 | +import NodeChannel from './ch-node'; |
22 | 21 | import {Dechunker, Chunker} from "./chunking"; |
23 | | -import hasFeature from "./features"; |
24 | | -import {Packer,Unpacker} from "./packstream"; |
25 | | -import {alloc, CombinedBuffer} from "./buf"; |
26 | | -import {Node, Relationship, UnboundRelationship, Path, PathSegment} from '../graph-types'; |
27 | | -import {int, isInt} from '../integer'; |
| 22 | +import hasFeature from './features'; |
| 23 | +import {Packer, Unpacker} from './packstream'; |
| 24 | +import {alloc} from './buf'; |
| 25 | +import {Node, Relationship, UnboundRelationship, Path, PathSegment} from '../graph-types' |
28 | 26 | import {newError} from './../error'; |
29 | | -import {ENCRYPTION_NON_LOCAL, ENCRYPTION_OFF, shouldEncrypt} from './util'; |
30 | 27 |
|
31 | 28 | let Channel; |
32 | 29 | if( WebSocketChannel.available ) { |
@@ -470,8 +467,8 @@ function connect( url, config = {}) { |
470 | 467 | return new Connection( new Ch({ |
471 | 468 | host: parseHost(url), |
472 | 469 | port: parsePort(url) || 7687, |
473 | | - // Default to using ENCRYPTION_NON_LOCAL if trust-on-first-use is available |
474 | | - encrypted : shouldEncrypt(config.encrypted, (hasFeature("trust_on_first_use") ? ENCRYPTION_NON_LOCAL : ENCRYPTION_OFF), parseHost(url)), |
| 470 | + // Default to using encryption if trust-on-first-use is available |
| 471 | + encrypted : (config.encrypted == null) ? hasFeature("trust_on_first_use") : config.encrypted, |
475 | 472 | // Default to using TRUST_ON_FIRST_USE if it is available |
476 | 473 | trust : config.trust || (hasFeature("trust_on_first_use") ? "TRUST_ON_FIRST_USE" : "TRUST_CUSTOM_CA_SIGNED_CERTIFICATES"), |
477 | 474 | trustedCertificates : config.trustedCertificates || [], |
|
0 commit comments