Skip to content

Commit

Permalink
fix tastytrade#18: prefer default TLS version over strict enforcement
Browse files Browse the repository at this point in the history
  • Loading branch information
osdevisnot committed Feb 13, 2024
1 parent c4b9a27 commit d38d946
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/services/tastytrade-http-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import axios from "axios"
import qs from 'qs'
import { recursiveDasherizeKeys } from "../utils/json-util"
import _ from 'lodash'
import https from 'https'
import { MinTlsVersion } from "../utils/constants"

const ParamsSerializer = {
serialize: function (queryParams: object) {
Expand All @@ -14,11 +12,9 @@ const ParamsSerializer = {

export default class TastytradeHttpClient{
public readonly session: TastytradeSession
private readonly httpsAgent: https.Agent

constructor(private readonly baseUrl: string) {
this.session = new TastytradeSession()
this.httpsAgent = new https.Agent({ minVersion: MinTlsVersion })
}

private getDefaultHeaders(): any {
Expand All @@ -42,8 +38,7 @@ export default class TastytradeHttpClient{
data: dasherizedData,
headers: mergedHeaders,
params: dasherizedParams,
paramsSerializer: ParamsSerializer,
httpsAgent: this.httpsAgent
paramsSerializer: ParamsSerializer
}, _.isEmpty)

return axios.request(config)
Expand Down

0 comments on commit d38d946

Please sign in to comment.