2016-01-18 15:59:35

How to debug encrypted API calls

I am writing this post in the hopes that someone doing a search will find useful information on debugging encrypted API calls.

How do you debug a request if the conversation is encrypted?  This isn't about figuring what version of TLS the server supports.  It is about the content of the request not being recognized by the API.

My technique is to intercept the conversation between the browser and the server and try to duplicate a working request.  You have to have a functioning example API call to make this work, but in this case we have the API docs to work with.  The example ruby code for a bid or offer is here:
https://starfighter.readme.io/docs/getting-started


The mechanics of this request can be investigated with ngrep:
http://sourceforge.net/projects/ngrep/


This is a tool like tcpdump that produces easy to read network captures.  Install it like so:

Download it:

[root@sl7-vm ~]# wget "http://downloads.sourceforge.net/project/ngrep/ngrep/1.45/ngrep-1.45.tar.bz2?r=http%3A%2F%2Fngrep.sourceforge.net%2Fdownload.html&ts=1452879259&use_mirror=netassist"

unpack it:

[root@sl7-vm ngrep]# tar xvfj ngrep-1.45.tar.bz2


Patch it:
[root@sl7-vm ngrep-1.45]# wget http://sourceforge.net/p/ngrep/bugs/_discuss/thread/ee4219d2/db82/attachment/patch
--2016-01-15 18:38:18--  http://sourceforge.net/p/ngrep/bugs/_discuss/thread/ee4219d2/db82/attachment/patch
Resolving sourceforge.net (sourceforge.net)... 216.34.181.60
Connecting to sourceforge.net (sourceforge.net)|216.34.181.60|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/octet-stream]
Saving to: ‘patch’

[root@sl7-vm ngrep-1.45]# patch < ./patch
[root@sl7-vm ngrep-1.45]# autoconf configure.in > configure

Install the prerequisites:
[root@sl7-vm ngrep-1.45]# yum install libpcap-devel

Configure it, build it, and install it:
[root@sl7-vm ngrep-1.45]# ./configure && make && make install

you should see this:

gcc -g -O2 -DLINUX -DHAVE_CONFIG_H  -D_BSD_SOURCE=1 -D__FAVOR_BSD=1  -I. -I/usr/include  -g -c ngrep.c
gcc -g -O2 -DLINUX -DHAVE_CONFIG_H  -D_BSD_SOURCE=1 -D__FAVOR_BSD=1  -L/usr/lib -s -o ngrep ngrep.o  regex-0.12/regex.o -lpcap
./install-sh -c -m 0755 ngrep  ///bin/ngrep
./install-sh -c -m 0644 ngrep.8 ///share/man/man8/ngrep.8

Got to love that autoconf.  Three slashes are better than one.

So what do we do with it?  This is the tricky part.  You are going to need stunnel for this part:
[root@sl7-vm ~]# yum install stunnel

make a certificate:
[root@sl7-vm mitm]# openssl req -batch -new -x509 -days 365 -nodes -out server.pem -keyout server.pem

now create a config file that looks like this:

[root@sl7-vm mitm]# cat stunnel-mitm-proxy.conf
debug = 3
#foreground = yes
pid =

[server]
client = no
cert= ./server.pem
accept = 127.0.0.1:443
connect = 127.0.0.1:4434

[client]
client = yes
accept = 127.0.0.1:4434
connect = api.stockfighter.io:443



This will create a Man In The Middle proxy server that will permit you to inspect traffic that would otherwise be end-to-end encrypted.  In order to use this proxy server you will need to either change the address you post to in your code to 127.0.0.1 or alter the /etc/hosts file like so:
127.0.0.1         api.stockfighter.io

This looks like something I will forget, so I opted to change my code.

You now need to run the proxy as root:
stunnel stunnel-mitm-proxy.conf

you can now start ngrep like so:
ngrep -W byline -d lo port 4434

This will look like nothing is happening.  That is fine just start your request in another window:

[starfighter@sl7-vm stockfighter]$ ruby first-trade.rb

You should see something like this:

#########
T 127.0.0.1:43643 -> 127.0.0.1:4434 [AP]
POST /ob/api/venues/AIDEX/stocks/LPEI/orders HTTP/1.1.
X-Starfighter-Authorization: REDACTED.
Connection: close.
Host: 127.0.0.1.
Content-Length: 116.
Content-Type: application/x-www-form-urlencoded.
.

##
T 127.0.0.1:43643 -> 127.0.0.1:4434 [AP]
{"account":"REDACTED","venue":"AIDEX","symbol":"LPEI","price":9000,"qty":100,"direction":"buy","orderType":"limit"}
##
T 127.0.0.1:4434 -> 127.0.0.1:43643 [AP]
HTTP/1.1 200 OK.
Server: nginx/1.8.0.
Date: Wed, 20 Jan 2016 14:59:33 GMT.
Content-Type: application/json.
Content-Length: 289.
Connection: keep-alive.
Strict-Transport-Security: max-age=31536000; includeSubdomains.
.
{
  "ok": true,
  "symbol": "LPEI",
  "venue": "AIDEX",
  "direction": "buy",
  "originalQty": 100,
  "qty": 100,
  "price": 9000,
  "orderType": "limit",
  "id": 6681,
  "account": "REDACTED",
  "ts": "2016-01-20T14:59:11.212784703Z",
  "fills": [],
  "totalFilled": 0,
  "open": true
}


If you are like me, you tried to do the same thing with wget and you saw this:
 {"ok":false,"error":"json: cannot unmarshal string into Go value of type main.OrderDesc"}

This puzzled me for a bit, but read on for a solution.  When I ran my wget command, using what I thought was the correct syntax  from the man page for wget, I got this in the ngrep window:
########
T 127.0.0.1:43625 -> 127.0.0.1:4434 [AP]
POST /ob/api/venues/JOGDEX/stocks/PIZ/orders HTTP/1.1.
User-Agent: Wget/1.14 (linux-gnu).
Accept: */*.
Host: 127.0.0.1.
Connection: Keep-Alive.
Content-Type: application/x-www-form-urlencoded.
Content-Length: 94.
X-Starfighter-Authorization: REDACTED.
.

##
T 127.0.0.1:43625 -> 127.0.0.1:4434 [AP]
"account=REDACTED&venue=JOGDEX&symbol=PIZ&price=5500&qty=100&direction=buy&orderType=limit"
##
T 127.0.0.1:4434 -> 127.0.0.1:43625 [AP]
HTTP/1.1 404 Not Found.
Server: nginx/1.8.0.
Date: Wed, 20 Jan 2016 14:39:38 GMT.
Content-Type: text/plain; charset=utf-8.
Content-Length: 62.
Connection: keep-alive.
.


So I set to work altering my code to look like the functional ruby script:

#export base_url="https://api.stockfighter.io/ob/api"
export base_url="https://127.0.0.1/ob/api"

# Set up the order
# must look like this:
# {"account":"REDACTED","venue":"AIDEX","symbol":"LPEI","price":5500,"qty":25,"direction":"buy","orderType":"limit"}

export order='{"account":"'$account'","venue":"'$venue'","symbol":"'$stock'","price":'$price',"qty":'$qty',"direction":"'$direction'","orderType":"'$orderType'"}'
export poststring="$base_url/venues/$venue/stocks/$stock/orders"
export content_type="Content-Type: application/json"
export headers="X-Starfighter-Authorization: $apikey"
wget --no-check-certificate --header=$content_type --header='X-Starfighter-Authorization: '$apikey'' --post-data=$order "$poststring"



That looks pretty gruesome, but it works.  This is the result:

 {
  "ok": true,
  "symbol": "LPEI",
  "venue": "AIDEX",
  "direction": "buy",
  "originalQty": 100,
  "qty": 100,
  "price": 9000,
  "orderType": "limit",
  "id": 6681,
  "account": "REDACTED",
  "ts": "2016-01-20T14:59:11.212784703Z",
  "fills": [],
  "totalFilled": 0,
  "open": true
}


Don't forget to change your code or the /etc/hosts file back.


Posted by StarFighter | Permanent link

2016-01-16 11:44:53

Choosing A Language

I'm back after a hectic holiday calendar and a bad flu. Fortunately in the intervening four weeks the platform has become more stable so we should be able to make more progress.

I just read an article about what it takes to be a stock broker at one of the biggest brokerage firms on wall street:

http://www.zerohedge.com/news/2016-01-14/so-you-want-be-citadel-trader-here-are-requirements

Note that "human" trading is not even mentioned in the posting:

Quantitative Trading Systems Developer: Undergraduate, Master’s, PhD and Postdoc (New Grads)

Location: Chicago, IL

Are you a natural programmer who loves to optimize and make systems more efficient? Do you have a sophisticated computational skillset – code optimization, systems architecture and library design? Do you know your core languages like you do your native tongue?

At Citadel, Quantitative Trading System Developers are responsible for designing, building, and optimizing our automated trading platform. Developers work closely with our research, simulation and live trading teams. We are seeking top undergraduate, master’s, and PhD students who are entrepreneurial self-starters and enjoy being in a fast-paced and dynamic environment for exciting opportunities in our automated quantitative trading businesses. This opportunity offers excellent exposure to a quantitative trading career path in one of the world’s leading global financial institutions.

If this is what excites you:

  • Developing core trading infrastructure
  • Designing low-latency, high-throughput trading systems
  • Optimizing massive parallel computing platforms.

And this is what you’ve got:

  • Advanced training in Computer Science, Computer Engineering, or other related fields
  • Extensive programming experience with strong object oriented design skills and fluency in C, C++, or Java
  • Expertise with algorithms and data structures
  • Demonstrated ability to communicate complex ideas in a clear, concise fashion
  • Ability to thrive in a complex, fast-paced, and highly technical environment

Useful:

  • Scripting languages (e.g., Linux shell, Python, Perl)
  • Analytical packages (e.g., R, Matlab)
  • FPGA development and high performance computing
  • NoSQL databases (e.g., MongoDB)
  • Distributed computing using MapReduce
  • Multi-threaded programming
  • Network programming

What caught my eye was the fact that not a single one of the 189 participants that have chosen to make their github repositories public have decided to write in R. R programming language is mature and stable and has an active user community. It is listed as one of the "useful" skills in the above job description. Note that the required skills are C, C++, and Java. Not a single one of the participants chose to write in C or C++ and only 13 of 189 or 6.8% chose to write in Java. In addition if you write in Python ( chosen by 15% of the participants ) you are considered to be writing in a "scripting" language. This word "scripting" is a pejorative that means that you are not writing a "real" program. It is somehow not as good as a real honest "man's" programming language. This is a slap in the face to all the Python, Perl and Bash programmer out there who's collective work holds the internet together. The arrogance and dismissive attitude galls me. I have written primarily in Bash for many years and I consider my work to be professional and of tremendous value.

chart of langages used on github for stockfighter challenge

One might conclude that the participants either do not wish to be hired, or think that their skill in other languages will be thought fungible. In light of the fact that the Stockfighter challenge bills itself as a job placement web site, I have to conclude the latter. My experience with human resource departments at large institutions is that they are inflexible and frankly incompetent. They cannot make a determination about the technical skills or conversely the trainability of candidates. In general if you know one language it is pretty easy to pick up another one in a matter of weeks. The current buzz word is "Object Orientation" and the job description mentions only C++ and Java as candidate OO languages. Given the huge academic and industry move to Java as a standard over the last 15 years or so I think it is a given that they are only looking for skill in Java and most likely specifically Hibernate + Spring + Maven or Java EE with all the trimmings. These frameworks take years to learn and genuinely are not fungible skills. Moreover, this type of programming damages your brain making you incapable of writing small efficient programs that can, for instance, trade stocks quickly.

Á Propos of my previous discussion on the stability and maturity of Python; it seems to me that there is an emphasis on Time to Market in the brokerage business rather than maintainability. This is the same pressure I saw in the advertising industry where web sites are frequently made live for a period of a few hours and never used again. My goal here is to write Functional Programs. To a considerable extent these Programming Paradigms are fads that come and go. Industry has latched on to Object Orientation because it allows them to write spaghetti code in a maintainable way. Functional programming by it's very nature produces clean compartmentalized code without excessive loops or branches. I write in R because it is stable and mature and above all because it is a rapid development environment. Functional Programming is a desirable, marketable life skill. I leave you with this excerpt from the Wikipedia page on Programming paradigms:

Parallel Computing


Main article: Parallel computing

Carnegie-Mellon University Professor Robert Harper in March 2011 wrote: "This semester Dan Licata and I are co-teaching a new course on functional programming for first-year prospective CS majors... Object-oriented programming is eliminated entirely from the introductory curriculum, because it is both anti-modular and anti-parallel by its very nature, and hence unsuitable for a modern CS curriculum. A proposed new course on object-oriented design methodology will be offered at the sophomore level for those students who wish to study this topic.


Posted by StarFighter | Permanent link

2015-12-21 21:54:32

View From Mount Stupid

I was dealing with family issues most of yesterday and today, but I am still plugging away at this.

I am now in my third day of the StockFighter challenge. two days ago you might recall, I managed to get the automated web browser httpie installed but it seems to have some problems with SSL.  I will spend a few cycles resolving those issues, but for the time being I want to focus on the other method mentioned in the API guide using the ruby language. Ruby is an interesting language. It was developed in Japan and the main developers speak Japanese.  Some of the discussion on the forums is exclusively in Japanese.  This would not bother me if the language was in a stable condition, like for instance C language, but it is not.  Ruby is in active development 20 years after it was released.  Some people call this "remaining relevant". I call it gratuitous fluff.  So, back to the challenge. The ruby program to handle the first trade is here:
https://starfighter.readme.io/docs/getting-started

I decided to try it. So here goes:


[starfighter@sl7-vm stockfighter]$ ruby first-trade.rb
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- httparty (LoadError)
        from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
        from first-trade.rb:2:in `<main>'


Let's read the docs ...

[starfighter@sl7-vm stockfighter]$ sudo gem install httparty
[sudo] password for starfighter:

Fetching: json-1.8.3.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing httparty:
        ERROR: Failed to build gem native extension.

    /usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h


Poo!


[root@sl7-vm ~]# yum install ruby-devel rubygems-devel rubygem-net-http-persistent ruby-doc rubygem-json

[snip]

Installed:
  ruby-devel.x86_64 0:2.0.0.598-25.el7_1                      ruby-doc.noarch 0:2.0.0.598-25.el7_1
  rubygem-net-http-persistent.noarch 0:2.8-5.el7              rubygems-devel.noarch 0:2.0.14-25.el7_1

Complete!
[root@sl7-vm ~]# gem install httparty
Fetching: json-1.8.3.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing httparty:
        ERROR: Failed to build gem native extension.

    /usr/bin/ruby extconf.rb
creating Makefile

make "DESTDIR="
gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I. -DJSON_GENERATOR    -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -mtune=generic -fPIC -m64 -o generator.o -c generator.c
make: gcc: Command not found
make: *** [generator.o] Error 127


Double poo! After 20 years don't you think this POS( Piece of Software ) should be self hosting?


[root@sl7-vm ~]# yum install gcc
Loaded plugins: langpacks
Resolving Dependencies

Installed:
  gcc.x86_64 0:4.8.3-9.el7

Dependency Installed:
  cpp.x86_64 0:4.8.3-9.el7                    glibc-devel.x86_64 0:2.17-78.el7 glibc-headers.x86_64 0:2.17-78.el7
  kernel-headers.x86_64 0:3.10.0-229.20.1.el7 libmpc.x86_64 0:1.0.1-3.el7      mpfr.x86_64 0:3.1.1-4.el7

Complete!
[root@sl7-vm ~]# gem install httparty
Building native extensions.  This could take a while...
Successfully installed json-1.8.3
Fetching: multi_xml-0.5.5.gem (100%)
Successfully installed multi_xml-0.5.5
Fetching: httparty-0.13.7.gem (100%)
When you HTTParty, you must party hard!
Successfully installed httparty-0.13.7
Parsing documentation for json-1.8.3
Installing ri documentation for json-1.8.3
Parsing documentation for multi_xml-0.5.5
Installing ri documentation for multi_xml-0.5.5
Parsing documentation for httparty-0.13.7
Installing ri documentation for httparty-0.13.7


Whee!!!!  Now we can party!

[starfighter@sl7-vm stockfighter]$ ruby first-trade.rb
{
  "ok": true,
  "symbol": "RKI",
  "venue": "YLMEX",
  "direction": "buy",
  "originalQty": 25,
  "qty": 25,
  "price": 8700,
  "orderType": "limit",
  "id": 5157,
  "account": "<redacted>",
  "ts": "2015-12-20T18:52:29.266964823Z",
  "fills": [],
  "totalFilled": 0,
  "open": true
}


So I'm making progress.  I'm wondering how many people will choose to fight this octopus to get to the stage of being able to launch an order.  I feel like I am junking up my machine and introducing security holes so I can run some idiosyncratic garbage that will be replaced in a few days.  That is not a exaggeration. Ruby 2.2.4 was released Dec. 16, 2015.  You can bet that most of those "gems" will need to be re-written to cope.  The last version of C was released in 2011.  If you where a C programmer you might not have noticed.  The C language is standardized ( via ANSI in 1989 or ISO in 1990 ).  Your programs would continue to work without rewrites.

I read an article yesterday about Mount Stupid:
mount stupid

The premise is that people that know nothing about a subject will broadcast their ignorance to the world.  So I am just climbing the front side of Mount Stupid right now.  I expect the decent to be a long trip so you can expect to hear from me for a long time.


Posted by StarFighter | Permanent link

2015-12-20 01:53:57

First Day and First Level

If you are making a game about programming, it seems to me that you should make it as accessible as possible. This is not a rant. I know next to nothing about programming and if someone introduces me to a new tool I don't reject it out of hand. However the very first level introduces me to the StockFighter API with this text:

Shell

# Let's try something different this time.  Sure, you could interact with the API
# in an actual programming language, but let me introduce you to httpie, a very
# cool tool.

# httpie is like curl, except much nicer to use.  See: https://github.com/jkbrzt/httpie

# You can install it via: 
# brew install httpie
# apt-get install httpie
# yum install httpie

# We'll start by creating a file representing our JSON request, like:

$ nano /tmp/order.json

# Copy/paste in:

{
  "account": "MST92145671",
  "venue": "LOBHEX",
  "stock": "LPEI",
  "qty": 100,
  "direction": "buy",
  "orderType": "market" 
}

# Got that ready?  Great, here's httpie magic:

$ http POST https://api.stockfighter.io/ob/api/venues/LOBHEX/stocks/LPEI/orders 'X-Starfighter-Authorization:copy-and-paste-your-API-key-here' < /tmp/order.json

# Now isn't that so much nicer than curl?
# No unnecessary headers (the Accept: application/json is implict.)
# You can inspect the requests quickly, with syntax highlighting.

# This is frequently useful when you're exploring a novel API.  Try it out!
# Most developers, after they get a handle on the endpoints, will want to
# write a more robust program in their language of choice, but httpie is
# a good choice for interactive programming when you want to figure out
# exactly what is happening when e.g. a library isn't working as expected.


Cool Right? I just put together a new virtual machine and got this blog software working. Now I want to try this API thingy so lets Fire up that httpie and see what happens!

[root@sl7-vm ~]# yum install httpie
Loaded plugins: langpacks
No package httpie available.
Error: Nothing to do

So I'm not easily dissuaded. I check out the web site here.

It says you can use something called "pip" if your favorite yum repo doesn't happen to have hippie in it. Let's try that:

[root@sl7-vm ~]# pip
-bash: pip: command not found

Hummm....

[root@sl7-vm ~]# easy_install pip
Searching for pip
Reading https://pypi.python.org/simple/pip/
Best match: pip 7.1.2
Downloading https://pypi.python.org/packages/source/p/pip/pip-7.1.2.tar.gz#md5=3823d2343d9f3aaab21cf9c917710196
Processing pip-7.1.2.tar.gz
Writing /tmp/easy_install-jC2noC/pip-7.1.2/setup.cfg
Running pip-7.1.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-jC2noC/pip-7.1.2/egg-dist-tmp-tBPFxY
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.mailmap'
warning: no previously-included files found matching '.travis.yml'
warning: no previously-included files found matching 'pip/_vendor/Makefile'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files found matching 'dev-requirements.txt'
no previously-included directories found matching '.travis'
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'contrib'
no previously-included directories found matching 'tasks'
no previously-included directories found matching 'tests'
Adding pip 7.1.2 to easy-install.pth file
Installing pip script to /usr/bin
Installing pip2.7 script to /usr/bin
Installing pip2 script to /usr/bin

Installed /usr/lib/python2.7/site-packages/pip-7.1.2-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip

[root@sl7-vm ~]# pip install --upgrade pip setuptools
/usr/lib/python2.7/site-packages/pip-7.1.2-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages/pip-7.1.2-py2.7.egg
Collecting setuptools
Downloading setuptools-19.1.1-py2.py3-none-any.whl (463kB)
100% |████████████████████████████████| 466kB 330kB/s
Installing collected packages: setuptools
Found existing installation: setuptools 0.9.8
Uninstalling setuptools-0.9.8:
Successfully uninstalled setuptools-0.9.8
Successfully installed setuptools-19.1.1
/usr/lib/python2.7/site-packages/pip-7.1.2-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning

[root@sl7-vm ~]# pip install --upgrade httpie
Collecting httpie
/usr/lib/python2.7/site-packages/pip-7.1.2-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading httpie-0.9.2-py2.py3-none-any.whl (66kB)
100% |████████████████████████████████| 69kB 556kB/s
Collecting requests>=2.3.0 (from httpie)
Downloading requests-2.9.0-py2.py3-none-any.whl (500kB)
100% |████████████████████████████████| 503kB 235kB/s
Collecting Pygments>=1.5 (from httpie)
Downloading Pygments-2.0.2-py2-none-any.whl (672kB)
100% |████████████████████████████████| 675kB 464kB/s
Installing collected packages: requests, Pygments, httpie
Successfully installed Pygments-2.0.2 httpie-0.9.2 requests-2.9.0
[root@sl7-vm ~]#


So what happened there? It looks to me like I just installed a package outside of the rpm database. In general I try to avoid doing that. It can lead to a situation known as "Dependency Hell". This was why the yum system was introduced. The intention was to avoid having to install packages from source. You will note that the pip package and the httpie package spray files all over the place. In addition this new POS ( Piece of Software) has introduced a security vulnerability into my relatively clean box. It is a pretty minor one, but it is not simple to fix. I am running Scientific Linux, a RedHat derivative. This is important because RedHat uses python for all of it's system software. Leaving aside for the moment advisability of writing crucial system software in an interpreted language, lets look at this security issue . The message I get when I try to install httpie says this:

InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.

The linked page tells me that my version of python needs a tweak (or three) to handle HTTPS requests. The recommended fix is to "upgrade" python to version 2.7.9 ( am running Python 2.7.5 ). I downloaded this OS today. It still has that new car smell. I will not "upgrade" python.


Long story short, This is a crappy tool. Why didn't you show an example using the tools that come with the OS? In my case that includes wget, cURL and ... what else? elinks maybe? There is another example on the page that uses ruby. I will write about that next time.

-StarFighter



Posted by StarFighter | Permanent link

2015-12-19 15:21:10

Stockfighter blog by StarFighter

This is my blog about the StockFighter on-line programming challenge. Stockfighter is an online programming "game" that requires you to write an automated trading system ( or several of them ).  This will be a difficult assignment, so I am writing this blog to serve as a quick reference and to motivate myself to complete the challenge.  The blog will almost certainly contain spoilers so don't read it if you want to find the answers yourself.  My technique will evolve as I go along so I don't know what language I will write in or what systems I will use.  The only thing I am sure of is that I do not wish to use any hints or assistance.  I have almost no experience in programming or stock markets so this will be a real education.  I expect that it will take me a long time to finish.  I hope that I will not be the last one to finish the challenge, but if I am the last one, then I will become "The Last StarFighter" ;-)


Shalom Aleikhem,
StarFighter

Posted by StarFighter | Permanent link | File under: stockfighter