handle urllib3 api changes; closes #2045