summaryrefslogtreecommitdiff
path: root/libcmis/libcmis-0.3.0-proxy.patch
blob: 7311b023e7bf517bf9c96f559cfaaca914cb70d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
diff --git NEWS NEWS
index 6e9c10d..0047613 100644
--- NEWS
+++ NEWS
@@ -50,3 +50,6 @@
   * Session factory automatically detects which binding to use
   * C wrapper API
   * Unit tests are now split between quick ones and the ones needing a CMIS server
+
+0.3.1
+  * Added support for proxy configuration
diff --git doc/cmis-client.xml doc/cmis-client.xml
index b7dce51..2d6cdea 100644
--- doc/cmis-client.xml
+++ doc/cmis-client.xml
@@ -213,6 +213,41 @@
 						</para>
           </listitem>
         </varlistentry>
+        <varlistentry>
+          <term>--proxy <replaceable class="parameter">url</replaceable></term>
+          <listitem>
+            <para>
+                Use <replaceable class="parameter">url</replaceable> as the HTTP proxy.
+                Setting this value will override the system proxy settings.
+						</para>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term>--proxy-username <replaceable class="parameter">login</replaceable></term>
+          <listitem>
+            <para>
+							Use <replaceable class="parameter">login</replaceable> to authenticate on the HTTP proxy.
+						</para>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term>--proxy-password <replaceable class="parameter">secret</replaceable></term>
+          <listitem>
+            <para>
+							Use <replaceable class="parameter">secret</replaceable> to authenticate on the HTTP proxy.
+						</para>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term>--noproxy <replaceable class="parameter">list</replaceable></term>
+          <listitem>
+            <para>
+                Proxy settings won't apply to hostnames and domain names listed 
+                in <replaceable class="parameter">list</replaceable>.
+                This value is a coma separated list.
+						</para>
+          </listitem>
+        </varlistentry>
       </variablelist>
     </refsect2>
     <refsect2>
diff --git src/cmis-client.cxx src/cmis-client.cxx
index 587a05b..432e140 100644
--- src/cmis-client.cxx
+++ src/cmis-client.cxx
@@ -121,11 +121,32 @@ libcmis::Session* CmisClient::getSession( ) throw ( CommandException, libcmis::E
             password = m_vm["password"].as< string >();
     }
 
+    // Look for proxy settings
+    string proxyUrl;
+    string proxyUser;
+    string proxyPass;
+    string noproxy;
+    if ( m_vm.count( "proxy" ) > 0 )
+    {
+        proxyUrl = m_vm["proxy"].as< string >();
+
+        if ( m_vm.count( "proxy-user" ) > 0 )
+            proxyUser = m_vm["proxy-user"].as< string >();
+        
+        if ( m_vm.count( "proxy-password" ) > 0 )
+            proxyPass = m_vm["proxy-password"].as< string >();
+
+        if ( m_vm.count( "noproxy" ) > 0 )
+            noproxy = m_vm["noproxy"].as< string >();
+
+        libcmis::SessionFactory::setProxySettings( proxyUrl, noproxy, proxyUser, proxyPass );
+    }
 
     bool verbose = m_vm.count( "verbose" ) > 0;
 
     string repoId;
-    list< libcmis::RepositoryPtr > repositories = libcmis::SessionFactory:: getRepositories( url, username, password, verbose );
+    list< libcmis::RepositoryPtr > repositories = libcmis::SessionFactory::getRepositories(
+            url, username, password, verbose );
     if ( repositories.size( ) == 1 )
         repoId = repositories.front( )->getId( );
     else
@@ -169,10 +190,31 @@ void CmisClient::execute( ) throw ( exception )
                     password = m_vm["password"].as< string >();
             }
 
+            // Look for proxy settings
+            string proxyUrl;
+            string proxyUser;
+            string proxyPass;
+            string noproxy;
+            if ( m_vm.count( "proxy" ) > 0 )
+            {
+                proxyUrl = m_vm["proxy"].as< string >();
+
+                if ( m_vm.count( "proxy-user" ) > 0 )
+                    proxyUser = m_vm["proxy-user"].as< string >();
+                
+                if ( m_vm.count( "proxy-password" ) > 0 )
+                    proxyPass = m_vm["proxy-password"].as< string >();
+
+                if ( m_vm.count( "noproxy" ) > 0 )
+                    noproxy = m_vm["noproxy"].as< string >();
+
+                libcmis::SessionFactory::setProxySettings( proxyUrl, noproxy, proxyUser, proxyPass );
+            }
 
             bool verbose = m_vm.count( "verbose" ) > 0;
 
-            list< libcmis::RepositoryPtr > repos = libcmis::SessionFactory::getRepositories( url, username, password, verbose );
+            list< libcmis::RepositoryPtr > repos = libcmis::SessionFactory::getRepositories(
+                    url, username, password, verbose );
         
             cout << "Repositories: name (id)" << endl;
             for ( list< libcmis::RepositoryPtr >::iterator it = repos.begin(); it != repos.end(); ++it )
@@ -828,6 +870,11 @@ options_description CmisClient::getOptionsDescription( )
         ( "repository,r", value< string >(), "Name of the repository to use" )
         ( "username,u", value< string >(), "Username used to authenticate to the repository" )
         ( "password,p", value< string >(), "Password used to authenticate to the repository" )
+        ( "proxy", value< string >(), "HTTP proxy url to override the system settings" )
+        ( "noproxy", value< string >(), "Coma separated list if host and domain names not going"
+                                        "through the proxy" )
+        ( "proxy-username", value< string >(), "Username to authenticate on the proxy" )
+        ( "proxy-password", value< string >(), "Password to authenticate on the proxy" )
     ;
 
     options_description setcontentOpts( "modification operations options" );
diff --git src/libcmis-c/session-factory.cxx src/libcmis-c/session-factory.cxx
index a171c82..7ebb278 100644
--- src/libcmis-c/session-factory.cxx
+++ src/libcmis-c/session-factory.cxx
@@ -37,6 +37,33 @@
 
 using namespace std;
 
+void libcmis_setProxySettings( char* proxy, char* noProxy,
+        char* proxyUser, char* proxyPass )
+{
+    libcmis::SessionFactory::setProxySettings( string( proxy ), string( noProxy ),
+            string( proxyUser ), string( proxyPass ) );
+}
+
+const char* libcmis_getProxy( )
+{
+    return libcmis::SessionFactory::getProxy( ).c_str();
+}
+
+const char* libcmis_getNoProxy( )
+{
+    return libcmis::SessionFactory::getNoProxy( ).c_str();
+}
+
+const char* libcmis_getProxyUser( )
+{
+    return libcmis::SessionFactory::getProxyUser( ).c_str();
+}
+
+const char* libcmis_getProxyPass( )
+{
+    return libcmis::SessionFactory::getProxyPass( ).c_str();
+}
+
 libcmis_SessionPtr libcmis_createSession(
         char* bindingUrl,
         char* repositoryId,
@@ -49,7 +76,8 @@ libcmis_SessionPtr libcmis_createSession(
 
     try
     {
-        libcmis::Session* handle = libcmis::SessionFactory::createSession( bindingUrl, username, password, repositoryId, verbose );
+        libcmis::Session* handle = libcmis::SessionFactory::createSession( bindingUrl, username,
+                password, repositoryId, verbose );
         session = new libcmis_session( );
         session->handle = handle;
     }
diff --git src/libcmis-c/session-factory.h src/libcmis-c/session-factory.h
index ad95acc..d28059e 100644
--- src/libcmis-c/session-factory.h
+++ src/libcmis-c/session-factory.h
@@ -34,6 +34,17 @@ extern "C" {
 
 #include "types.h"
 
+void libcmis_setProxySettings(
+        char* proxy,
+        char* noProxy,
+        char* proxyUser,
+        char* proxyPass );
+
+const char* libcmis_getProxy( );
+const char* libcmis_getNoProxy( );
+const char* libcmis_getProxyUser( );
+const char* libcmis_getProxyPass( );
+
 libcmis_SessionPtr libcmis_createSession(
         char* bindingUrl,
         char* repositoryId,
diff --git src/libcmis/atom-session.cxx src/libcmis/atom-session.cxx
index 1716755..1f8ac2d 100644
--- src/libcmis/atom-session.cxx
+++ src/libcmis/atom-session.cxx
@@ -39,7 +39,7 @@
 
 using namespace std;
 
-AtomPubSession::AtomPubSession( string atomPubUrl, string repositoryId, 
+AtomPubSession::AtomPubSession( string atomPubUrl, string repositoryId,
         string username, string password, bool verbose ) throw ( libcmis::Exception ) :
     BaseSession( atomPubUrl, repositoryId, username, password, verbose ),
     m_repository( )
@@ -139,7 +139,8 @@ void AtomPubSession::initialize( ) throw ( libcmis::Exception )
 
 }
 
-list< libcmis::RepositoryPtr > AtomPubSession::getRepositories( string url, string username, string password, bool verbose ) throw ( libcmis::Exception )
+list< libcmis::RepositoryPtr > AtomPubSession::getRepositories( string url, string username,
+        string password, bool verbose ) throw ( libcmis::Exception )
 {
     AtomPubSession session( url, string(), username, password, verbose );
     return session.m_repositories;
diff --git src/libcmis/atom-session.hxx src/libcmis/atom-session.hxx
index 568b9b0..29eb359 100644
--- src/libcmis/atom-session.hxx
+++ src/libcmis/atom-session.hxx
@@ -39,7 +39,7 @@ class AtomPubSession : public BaseSession
     public:
         AtomPubSession( std::string sAtomPubUrl, std::string repositoryId,
                         std::string username, std::string password,
-                        bool verbose ) throw ( libcmis::Exception );
+                        bool verbose =false ) throw ( libcmis::Exception );
         AtomPubSession( const AtomPubSession& copy );
         ~AtomPubSession( );
 
diff --git src/libcmis/base-session.cxx src/libcmis/base-session.cxx
index adc030e..b007a9d 100644
--- src/libcmis/base-session.cxx
+++ src/libcmis/base-session.cxx
@@ -33,6 +33,7 @@
 #include <libxml/xpath.h>
 
 #include "base-session.hxx"
+#include "session-factory.hxx"
 #include "xml-utils.hxx"
 
 using namespace std;
@@ -105,11 +106,12 @@ namespace
     }
 }
 
-BaseSession::BaseSession( string atomPubUrl, string repositoryId, 
-        string username, string password, bool verbose ) throw ( libcmis::Exception ) :
+BaseSession::BaseSession( string atomPubUrl, string repositoryId, string username,
+        string password, bool verbose ) throw ( libcmis::Exception ) :
     Session( ),
     m_authProvider( ),
     m_curlHandle( NULL ),
+    m_no100Continue( false ),
     m_bindingUrl( atomPubUrl ),
     m_repositoryId( repositoryId ),
     m_username( username ),
@@ -127,6 +129,7 @@ BaseSession::BaseSession( const BaseSession& copy ) :
     Session( ),
     m_authProvider( copy.m_authProvider ),
     m_curlHandle( NULL ),
+    m_no100Continue( copy.m_no100Continue ),
     m_bindingUrl( copy.m_bindingUrl ),
     m_repositoryId( copy.m_repositoryId ),
     m_username( copy.m_username ),
@@ -141,11 +144,11 @@ BaseSession::BaseSession( const BaseSession& copy ) :
     m_curlHandle = curl_easy_init( );
 }
 
-
 BaseSession& BaseSession::operator=( const BaseSession& copy )
 {
     m_authProvider = copy.m_authProvider;
     m_curlHandle = NULL;
+    m_no100Continue = copy.m_no100Continue;
     m_bindingUrl = copy.m_bindingUrl;
     m_repositoryId = copy.m_repositoryId;
     m_username = copy.m_username;
@@ -186,7 +189,7 @@ string BaseSession::createUrl( const string& pattern, map< string, string > vari
         if ( pos != string::npos )
         {
             // Escape the URL by chunks
-#if LIBCURL_VERSION_VALUE >= 0x071504
+#if LIBCURL_VERSION_VALUE >= 0x070F04
             char* escaped = curl_easy_escape( m_curlHandle, value.c_str(), value.length() );
 #else
             char* escaped = curl_escape( value.c_str(), value.length() );
@@ -215,6 +218,9 @@ string BaseSession::createUrl( const string& pattern, map< string, string > vari
 
 libcmis::HttpResponsePtr BaseSession::httpGetRequest( string url ) throw ( CurlException )
 {
+    // Reset the handle for the request
+    curl_easy_reset( m_curlHandle );
+
     libcmis::HttpResponsePtr response( new libcmis::HttpResponse( ) );
 
     curl_easy_setopt( m_curlHandle, CURLOPT_WRITEFUNCTION, lcl_bufferData );
@@ -244,6 +250,9 @@ libcmis::HttpResponsePtr BaseSession::httpGetRequest( string url ) throw ( CurlE
 
 libcmis::HttpResponsePtr BaseSession::httpPutRequest( string url, istream& is, vector< string > headers ) throw ( CurlException )
 {
+    // Reset the handle for the request
+    curl_easy_reset( m_curlHandle );
+
     libcmis::HttpResponsePtr response( new libcmis::HttpResponse( ) );
 
     curl_easy_setopt( m_curlHandle, CURLOPT_WRITEFUNCTION, lcl_bufferData );
@@ -266,12 +275,32 @@ libcmis::HttpResponsePtr BaseSession::httpPutRequest( string url, istream& is, v
     struct curl_slist *headers_slist = NULL;
     for ( vector< string >::iterator it = headers.begin( ); it != headers.end( ); ++it )
         headers_slist = curl_slist_append( headers_slist, it->c_str( ) );
+
+    // If we know for sure that 100-Continue won't be accepted,
+    // don't even try with it to save one HTTP request.
+    if ( m_no100Continue )
+        headers_slist = curl_slist_append( headers_slist, "Expect:" );
     curl_easy_setopt( m_curlHandle, CURLOPT_HTTPHEADER, headers_slist );
 
     try
     {
         httpRunRequest( url );
         response->getData( )->finish();
+
+        /** If we had a HTTP 417 response, this is likely to be due to some 
+            HTTP 1.0 proxy / server not accepting the "Expect: 100-continue"
+            header. Try to disable this header and try again.
+          */
+        if ( getHttpStatus() == 417 )
+        {
+            headers_slist = curl_slist_append( headers_slist, "Expect:" );
+            curl_easy_setopt( m_curlHandle, CURLOPT_HTTPHEADER, headers_slist );
+            httpRunRequest( url );
+            response->getData( )->finish();
+
+            // Remember that we don't want 100-Continue for the future requests
+            m_no100Continue = true;
+        }
     }
     catch ( CurlException& e )
     {
@@ -286,6 +315,9 @@ libcmis::HttpResponsePtr BaseSession::httpPutRequest( string url, istream& is, v
 
 libcmis::HttpResponsePtr BaseSession::httpPostRequest( string url, istringstream& is, string contentType ) throw ( CurlException )
 {
+    // Reset the handle for the request
+    curl_easy_reset( m_curlHandle );
+
     libcmis::HttpResponsePtr response( new libcmis::HttpResponse( ) );
 
     curl_easy_setopt( m_curlHandle, CURLOPT_WRITEFUNCTION, lcl_bufferData );
@@ -308,12 +340,32 @@ libcmis::HttpResponsePtr BaseSession::httpPostRequest( string url, istringstream
     struct curl_slist *headers_slist = NULL;
     string contentTypeHeader = string( "Content-Type:" ) + contentType;
     headers_slist = curl_slist_append( headers_slist, contentTypeHeader.c_str( ) );
+
+    // If we know for sure that 100-Continue won't be accepted,
+    // don't even try with it to save one HTTP request.
+    if ( m_no100Continue )
+        headers_slist = curl_slist_append( headers_slist, "Expect:" );
     curl_easy_setopt( m_curlHandle, CURLOPT_HTTPHEADER, headers_slist );
 
     try
     {
         httpRunRequest( url );
         response->getData( )->finish();
+
+        /** If we had a HTTP 417 response, this is likely to be due to some 
+            HTTP 1.0 proxy / server not accepting the "Expect: 100-continue"
+            header. Try to disable this header and try again.
+          */
+        if ( getHttpStatus() == 417 )
+        {
+            headers_slist = curl_slist_append( headers_slist, "Expect:" );
+            curl_easy_setopt( m_curlHandle, CURLOPT_HTTPHEADER, headers_slist );
+            httpRunRequest( url );
+            response->getData( )->finish();
+
+            // Remember that we don't want 100-Continue for the future requests
+            m_no100Continue = true;
+        }
     }
     catch ( const CurlException& e )
     {
@@ -328,6 +380,9 @@ libcmis::HttpResponsePtr BaseSession::httpPostRequest( string url, istringstream
 
 void BaseSession::httpDeleteRequest( string url ) throw ( CurlException )
 {
+    // Reset the handle for the request
+    curl_easy_reset( m_curlHandle );
+
     curl_easy_setopt( m_curlHandle, CURLOPT_CUSTOMREQUEST, "DELETE" );
     httpRunRequest( url );
 }
@@ -351,7 +406,7 @@ void BaseSession::httpRunRequest( string url ) throw ( CurlException )
     {
         curl_easy_setopt( m_curlHandle, CURLOPT_HTTPAUTH, CURLAUTH_ANY );
 
-#if LIBCURL_VERSION_VALUE >= 0x071901
+#if LIBCURL_VERSION_VALUE >= 0x071301
         curl_easy_setopt( m_curlHandle, CURLOPT_USERNAME, m_username.c_str() );
         curl_easy_setopt( m_curlHandle, CURLOPT_PASSWORD, m_password.c_str() );
 #else
@@ -360,6 +415,28 @@ void BaseSession::httpRunRequest( string url ) throw ( CurlException )
 #endif
     }
 
+    // Set the proxy configuration if any
+    if ( !libcmis::SessionFactory::getProxy( ).empty() )
+    {
+        curl_easy_setopt( m_curlHandle, CURLOPT_PROXY, libcmis::SessionFactory::getProxy( ).c_str() );
+#if LIBCURL_VERSION_VALUE >= 0x071304
+        curl_easy_setopt( m_curlHandle, CURLOPT_NOPROXY, libcmis::SessionFactory::getNoProxy( ).c_str() );
+#endif
+        const string& proxyUser = libcmis::SessionFactory::getProxyUser( );
+        const string& proxyPass = libcmis::SessionFactory::getProxyPass( );
+        if ( !proxyUser.empty( ) && !proxyPass.empty( ) )
+        {
+            curl_easy_setopt( m_curlHandle, CURLOPT_PROXYAUTH, CURLAUTH_ANY ); 
+#if LIBCURL_VERSION_VALUE >= 0X071301
+            curl_easy_setopt( m_curlHandle, CURLOPT_PROXYUSERNAME, proxyUser.c_str( ) );
+            curl_easy_setopt( m_curlHandle, CURLOPT_PROXYPASSWORD, proxyPass.c_str( ) );
+#else
+            string userpwd = proxyUser + ":" + proxyPass;
+            curl_easy_setopt( m_curlHandle, CURLOPT_PROXYUSERPWD, userpwd.c_str( ) );
+#endif
+        }
+    }
+
     // Get some feedback when something wrong happens
     char errBuff[CURL_ERROR_SIZE];
     curl_easy_setopt( m_curlHandle, CURLOPT_ERRORBUFFER, errBuff );
@@ -373,9 +450,6 @@ void BaseSession::httpRunRequest( string url ) throw ( CurlException )
 
     // Perform the query
     CURLcode errCode = curl_easy_perform( m_curlHandle );
-    
-    // Reset the handle for the next request
-    curl_easy_reset( m_curlHandle );
 
     bool isHttpError = errCode == CURLE_HTTP_RETURNED_ERROR;
     if ( CURLE_OK != errCode && !( m_noHttpErrors && isHttpError ) )
diff --git src/libcmis/base-session.hxx src/libcmis/base-session.hxx
index fb95ba7..0b90c1f 100644
--- src/libcmis/base-session.hxx
+++ src/libcmis/base-session.hxx
@@ -94,6 +94,7 @@ class BaseSession : public libcmis::Session
         libcmis::AuthProviderPtr m_authProvider;
 
         CURL* m_curlHandle;
+        bool  m_no100Continue;
 
     protected:
         std::string m_bindingUrl;
@@ -110,7 +111,7 @@ class BaseSession : public libcmis::Session
     public:
         BaseSession( std::string sBindingUrl, std::string repository,
                         std::string username, std::string password,
-                        bool verbose ) throw ( libcmis::Exception );
+                        bool verbose = false ) throw ( libcmis::Exception );
         BaseSession( const BaseSession& copy );
         ~BaseSession( );
 
@@ -137,8 +138,6 @@ class BaseSession : public libcmis::Session
         libcmis::HttpResponsePtr httpPostRequest( std::string url, std::istringstream& is, std::string contentType ) throw ( CurlException );
         void httpDeleteRequest( std::string url ) throw ( CurlException );
 
-        void httpRunRequest( std::string url ) throw ( CurlException );
-
         long getHttpStatus( );
 
         // Session methods
@@ -148,6 +147,8 @@ class BaseSession : public libcmis::Session
         virtual libcmis::FolderPtr getFolder( std::string id ) throw ( libcmis::Exception );
 
         virtual void setAuthenticationProvider( libcmis::AuthProviderPtr provider ) { m_authProvider = provider; }
+    private:
+        void httpRunRequest( std::string url ) throw ( CurlException );
 };
 
 #endif
diff --git src/libcmis/session-factory.cxx src/libcmis/session-factory.cxx
index d7d886b..afe6943 100644
--- src/libcmis/session-factory.cxx
+++ src/libcmis/session-factory.cxx
@@ -33,8 +33,23 @@ using namespace std;
 
 namespace libcmis
 {
+    string SessionFactory::s_proxy;
+    string SessionFactory::s_noProxy;
+    string SessionFactory::s_proxyUser;
+    string SessionFactory::s_proxyPass;
+
+    void SessionFactory::setProxySettings( string proxy, string noProxy,
+            string proxyUser, string proxyPass )
+    {
+        SessionFactory::s_proxy = proxy;
+        SessionFactory::s_noProxy = noProxy;
+        SessionFactory::s_proxyUser = proxyUser;
+        SessionFactory::s_proxyPass = proxyPass;
+    }
+
     Session* SessionFactory::createSession( string bindingUrl, string username,
-            string password, string repository, bool verbose ) throw ( Exception )
+            string password, string repository,
+            bool verbose ) throw ( Exception )
     {
         Session* session = NULL;
         
@@ -68,8 +83,8 @@ namespace libcmis
         return session;
     }
 
-    list< RepositoryPtr > SessionFactory::getRepositories( string bindingUrl, string username,
-            string password, bool verbose ) throw ( Exception )
+    list< RepositoryPtr > SessionFactory::getRepositories( string bindingUrl,
+            string username, string password, bool verbose ) throw ( Exception )
     {
         list< RepositoryPtr > repos;
 
diff --git src/libcmis/session-factory.hxx src/libcmis/session-factory.hxx
index 677c2ab..598497f 100644
--- src/libcmis/session-factory.hxx
+++ src/libcmis/session-factory.hxx
@@ -40,8 +40,24 @@ namespace libcmis
 {
     class SessionFactory
     {
+        private:
+            static std::string s_proxy;
+            static std::string s_noProxy;
+            static std::string s_proxyUser;
+            static std::string s_proxyPass;
+
         public:
 
+            static void setProxySettings( std::string proxy,
+                    std::string noProxy,
+                    std::string proxyUser,
+                    std::string proxyPass );
+
+            static const std::string& getProxy() { return s_proxy; }
+            static const std::string& getNoProxy() { return s_noProxy; }
+            static const std::string& getProxyUser() { return s_proxyUser; }
+            static const std::string& getProxyPass() { return s_proxyPass; }
+
             /** Create a session from the given parameters. The binding type is automatically
                 detected based on the provided URL.
 
diff --git src/libcmis/test-atom.cxx src/libcmis/test-atom.cxx
index 4ee64ea..624078d 100644
--- src/libcmis/test-atom.cxx
+++ src/libcmis/test-atom.cxx
@@ -211,7 +211,7 @@ class TestAuthProvider : public libcmis::AuthProvider
 
 void AtomTest::authCallbackTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, string( ), false);
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, string( ) );
 
     // Test cancelled authentication
     {
@@ -239,7 +239,7 @@ void AtomTest::authCallbackTest( )
 
 void AtomTest::getUnexistantTypeTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
     
     try
     {
@@ -254,7 +254,7 @@ void AtomTest::getUnexistantTypeTest( )
 
 void AtomTest::getNormalTypeTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
     
     libcmis::ObjectTypePtr type = session.getType( TEST_TYPE_ID );
 
@@ -265,7 +265,7 @@ void AtomTest::getNormalTypeTest( )
 
 void AtomTest::getTypeChildrenTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
     
     libcmis::ObjectTypePtr type = session.getType( CHILDREN_TEST_TYPE_ID );
     vector< libcmis::ObjectTypePtr > children = type->getChildren( );
@@ -275,7 +275,7 @@ void AtomTest::getTypeChildrenTest( )
 
 void AtomTest::getUnexistantFolderTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
 
     try
     {
@@ -290,7 +290,7 @@ void AtomTest::getUnexistantFolderTest( )
 
 void AtomTest::getUnexistantObjectTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
     
     try
     {
@@ -305,7 +305,7 @@ void AtomTest::getUnexistantObjectTest( )
 
 void AtomTest::getFolderFromOtherNodeTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
     libcmis::FolderPtr folder = session.getFolder( TEST_DOCUMENT_ID );
 
     CPPUNIT_ASSERT_MESSAGE( "Nothing should be returned: not a folder",
@@ -314,7 +314,7 @@ void AtomTest::getFolderFromOtherNodeTest( )
 
 void AtomTest::getFolderCreationFromUrlTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
     libcmis::FolderPtr folder = session.getFolder( TEST_FOLDER_ID );
 
     AtomFolder* atomFolder = dynamic_cast< AtomFolder* >( folder.get( ) );
@@ -336,7 +336,7 @@ void AtomTest::getFolderCreationFromUrlTest( )
 
 void AtomTest::getDocumentCreationFromUrlTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
     libcmis::ObjectPtr object = session.getObject( TEST_DOCUMENT_ID );
 
     AtomDocument* atomDocument = dynamic_cast< AtomDocument* >( object.get( ) );
@@ -359,7 +359,7 @@ void AtomTest::getDocumentCreationFromUrlTest( )
 
 void AtomTest::getByPathValidTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
     try
     {
         libcmis::ObjectPtr object = session.getObjectByPath( TEST_PATH_VALID );
@@ -376,7 +376,7 @@ void AtomTest::getByPathValidTest( )
 
 void AtomTest::getByPathInvalidTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
     try
     {
         libcmis::ObjectPtr object = session.getObjectByPath( TEST_PATH_INVALID );
@@ -391,7 +391,7 @@ void AtomTest::getByPathInvalidTest( )
         
 void AtomTest::getAllowableActionsTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
     libcmis::FolderPtr folder = session.getRootFolder( );
 
     boost::shared_ptr< libcmis::AllowableActions > toCheck = folder->getAllowableActions( );
@@ -405,7 +405,7 @@ void AtomTest::getAllowableActionsTest( )
 
 void AtomTest::getChildrenTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
     libcmis::FolderPtr folder = session.getRootFolder( );
 
     vector< libcmis::ObjectPtr > children = folder->getChildren( );
@@ -429,7 +429,7 @@ void AtomTest::getChildrenTest( )
 
 void AtomTest::getObjectParentsTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
     libcmis::ObjectPtr object = session.getObject( TEST_DOCUMENT_ID );
     libcmis::Document* document = dynamic_cast< libcmis::Document* >( object.get() );
     
@@ -445,7 +445,7 @@ void AtomTest::getObjectParentsTest( )
 
 void AtomTest::getContentStreamTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
     libcmis::ObjectPtr object = session.getObject( TEST_DOCUMENT_ID );
     libcmis::Document* document = dynamic_cast< libcmis::Document* >( object.get() );
     
@@ -467,7 +467,7 @@ void AtomTest::getContentStreamTest( )
 
 void AtomTest::setContentStreamTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
     libcmis::ObjectPtr object = session.getObject( TEST_DOCUMENT_ID );
     libcmis::Document* document = dynamic_cast< libcmis::Document* >( object.get() );
     
@@ -503,7 +503,7 @@ void AtomTest::setContentStreamTest( )
 
 void AtomTest::updatePropertiesTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
 
     // Values for the test
     libcmis::ObjectPtr object = session.getObject( "114" );
@@ -530,7 +530,7 @@ void AtomTest::updatePropertiesTest( )
 
 void AtomTest::createFolderTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
     libcmis::FolderPtr parent = session.getFolder( session.getRootId( ) );
 
     // Prepare the properties for the new object, object type is cmis:folder
@@ -564,7 +564,7 @@ void AtomTest::createFolderTest( )
 
 void AtomTest::createFolderBadTypeTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
     libcmis::FolderPtr parent = session.getFolder( session.getRootId( ) );
 
     // Prepare the properties for the new object, object type is cmis:document to trigger the exception
@@ -603,7 +603,7 @@ void AtomTest::createFolderBadTypeTest( )
 
 void AtomTest::createDocumentTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
     libcmis::FolderPtr parent = session.getFolder( session.getRootId( ) );
 
     // Prepare the properties for the new object, object type is cmis:folder
@@ -647,7 +647,7 @@ void AtomTest::createDocumentTest( )
 
 void AtomTest::deleteDocumentTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
 
     string id( "130" );
     libcmis::ObjectPtr object = session.getObject( id );
@@ -669,7 +669,7 @@ void AtomTest::deleteDocumentTest( )
 
 void AtomTest::deleteTreeTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
 
     string id( "117" );
     libcmis::ObjectPtr object = session.getObject( id );
@@ -691,7 +691,7 @@ void AtomTest::deleteTreeTest( )
 
 void AtomTest::checkOutTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
 
     // First create a document of type VersionableType
     libcmis::DocumentPtr doc = test::createVersionableDocument( &session, "checkOutTest" );
@@ -709,7 +709,7 @@ void AtomTest::checkOutTest( )
 
 void AtomTest::cancelCheckOutTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
 
     // First create a versionable document and check it out
     libcmis::DocumentPtr doc = test::createVersionableDocument( &session, "cancelCheckOutTest" );
@@ -734,7 +734,7 @@ void AtomTest::cancelCheckOutTest( )
 
 void AtomTest::checkInTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
 
     // First create a versionable document and check it out
     libcmis::DocumentPtr doc = test::createVersionableDocument( &session, "checkInTest" );
@@ -770,7 +770,7 @@ void AtomTest::checkInTest( )
 
 void AtomTest::getAllVersionsTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
 
     // First create a versionable document and check it out
     libcmis::DocumentPtr doc = test::createVersionableDocument( &session, "getAllVersionsTest" );
@@ -795,7 +795,7 @@ void AtomTest::getAllVersionsTest( )
 
 void AtomTest::moveTest( )
 {
-    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD, false );
+    AtomPubSession session( SERVER_ATOM_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD );
     
     string id( "135" );
     libcmis::ObjectPtr object = session.getObject( id );
diff --git src/libcmis/test-ws.cxx src/libcmis/test-ws.cxx
index 1b5dfee..ad564bc 100644
--- src/libcmis/test-ws.cxx
+++ src/libcmis/test-ws.cxx
@@ -136,19 +136,19 @@ void WSTest::getRepositoriesTest()
 
 void WSTest::sessionCreationTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "", SERVER_USERNAME, SERVER_PASSWORD );
     CPPUNIT_ASSERT_MESSAGE( "No RepositoryService URL", !session.getServiceUrl( "RepositoryService" ).empty( ) );
 }
 
 void WSTest::getRepositoryTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
     CPPUNIT_ASSERT_EQUAL_MESSAGE( "Repository info badly retrieved", string( "100" ), session.getRepository()->getRootId( ) );
 }
 
 void WSTest::getRepositoryBadTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "", SERVER_USERNAME, SERVER_PASSWORD );
     try
     {
         session.getRepositoryService( ).getRepositoryInfo( "bad" );
@@ -164,7 +164,7 @@ void WSTest::getRepositoryBadTest( )
 
 void WSTest::getTypeDefinitionTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
     string id( "ComplexType" ); 
     libcmis::ObjectTypePtr actual = session.getType( id );
 
@@ -175,7 +175,7 @@ void WSTest::getTypeDefinitionTest( )
 
 void WSTest::getTypeDefinitionErrorTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
     
     string id( "bad_type" );
     try
@@ -192,7 +192,7 @@ void WSTest::getTypeDefinitionErrorTest( )
 
 void WSTest::getTypeChildrenTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
     libcmis::ObjectTypePtr actual = session.getType( "cmis:document" );
 
     vector< libcmis::ObjectTypePtr > children = actual->getChildren( );
@@ -202,7 +202,7 @@ void WSTest::getTypeChildrenTest( )
 
 void WSTest::getObjectTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
     string id( "101" ); 
     libcmis::ObjectPtr actual = session.getObject( id );
 
@@ -217,7 +217,7 @@ void WSTest::getObjectTest( )
 
 void WSTest::getObjectDocumentTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
     string id( "114" ); 
     libcmis::ObjectPtr actual = session.getObject( id );
 
@@ -232,7 +232,7 @@ void WSTest::getObjectDocumentTest( )
 
 void WSTest::getObjectParentsTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
     libcmis::ObjectPtr object = session.getObject( "116" );
     libcmis::Document* document = dynamic_cast< libcmis::Document* >( object.get() );
     
@@ -248,7 +248,7 @@ void WSTest::getObjectParentsTest( )
 
 void WSTest::getChildrenTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
     libcmis::FolderPtr folder = session.getRootFolder( );
 
     vector< libcmis::ObjectPtr > children = folder->getChildren( );
@@ -270,7 +270,7 @@ void WSTest::getChildrenTest( )
 
 void WSTest::getByPathValidTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
     try
     {
         libcmis::ObjectPtr object = session.getObjectByPath( "/My_Folder-0-0/My_Document-1-2" );
@@ -287,7 +287,7 @@ void WSTest::getByPathValidTest( )
 
 void WSTest::getByPathInvalidTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
     try
     {
         libcmis::ObjectPtr object = session.getObjectByPath( "/some/dummy/path" );
@@ -302,7 +302,7 @@ void WSTest::getByPathInvalidTest( )
 
 void WSTest::updatePropertiesTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
     
     // Values for the test
     libcmis::ObjectPtr object = session.getObject( "114" );
@@ -329,7 +329,7 @@ void WSTest::updatePropertiesTest( )
 
 void WSTest::createFolderTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
     libcmis::FolderPtr parent = session.getFolder( session.getRootId( ) );
 
     // Prepare the properties for the new object, object type is cmis:folder
@@ -363,7 +363,7 @@ void WSTest::createFolderTest( )
 
 void WSTest::createFolderBadTypeTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
     libcmis::FolderPtr parent = session.getFolder( session.getRootId( ) );
 
     // Prepare the properties for the new object, object type is cmis:document to trigger the exception
@@ -401,7 +401,7 @@ void WSTest::createFolderBadTypeTest( )
 
 void WSTest::createDocumentTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
     libcmis::FolderPtr parent = session.getFolder( session.getRootId( ) );
 
     // Prepare the properties for the new object, object type is cmis:folder
@@ -444,7 +444,7 @@ void WSTest::createDocumentTest( )
 
 void WSTest::deleteObjectTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
 
     // Get the object to remove
     string id( "130" );
@@ -467,7 +467,7 @@ void WSTest::deleteObjectTest( )
 
 void WSTest::deleteTreeTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
 
     string id( "117" );
     libcmis::ObjectPtr object = session.getObject( id );
@@ -489,7 +489,7 @@ void WSTest::deleteTreeTest( )
 
 void WSTest::moveTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
     
     string id( "135" );
     libcmis::ObjectPtr object = session.getObject( id );
@@ -508,7 +508,7 @@ void WSTest::moveTest( )
 
 void WSTest::getContentStreamTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
     libcmis::ObjectPtr object = session.getObject( "116" );
     libcmis::Document* document = dynamic_cast< libcmis::Document* >( object.get() );
     
@@ -532,7 +532,7 @@ void WSTest::getContentStreamTest( )
 
 void WSTest::setContentStreamTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
     libcmis::ObjectPtr object = session.getObject( "116" );
     libcmis::Document* document = dynamic_cast< libcmis::Document* >( object.get() );
     
@@ -570,7 +570,7 @@ void WSTest::setContentStreamTest( )
 
 void WSTest::checkOutTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
 
     // First create a document of type VersionableType
     libcmis::DocumentPtr doc = test::createVersionableDocument( &session, "checkOutTest" );
@@ -588,7 +588,7 @@ void WSTest::checkOutTest( )
 
 void WSTest::cancelCheckOutTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
 
     // First create a versionable document and check it out
     libcmis::DocumentPtr doc = test::createVersionableDocument( &session, "cancelCheckOutTest" );
@@ -613,7 +613,7 @@ void WSTest::cancelCheckOutTest( )
 
 void WSTest::checkInTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
 
     // First create a versionable document and check it out
     libcmis::DocumentPtr doc = test::createVersionableDocument( &session, "checkInTest" );
@@ -649,7 +649,7 @@ void WSTest::checkInTest( )
 
 void WSTest::getAllVersionsTest( )
 {
-    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD, false );
+    WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD );
 
     // First create a versionable document and check it out
     libcmis::DocumentPtr doc = test::createVersionableDocument( &session, "getAllVersionsTest" );
diff --git src/libcmis/ws-relatedmultipart.cxx src/libcmis/ws-relatedmultipart.cxx
index 37f133a..ef91b4d 100644
--- src/libcmis/ws-relatedmultipart.cxx
+++ src/libcmis/ws-relatedmultipart.cxx
@@ -299,7 +299,7 @@ boost::shared_ptr< istream > getStreamFromNode( xmlNodePtr node, RelatedMultipar
             {
                 id = href.substr( 4 );
                 // URL-decode the id
-#if LIBCURL_VERSION_VALUE >= 0x071504
+#if LIBCURL_VERSION_VALUE >= 0x070F04
                 char* escaped = curl_easy_unescape( NULL, id.c_str(), id.length(), NULL );
 #else
                 char* escaped = curl_unescape( id.c_str(), id.length() );
diff --git src/libcmis/ws-session.cxx src/libcmis/ws-session.cxx
index b906a5a..f551109 100644
--- src/libcmis/ws-session.cxx
+++ src/libcmis/ws-session.cxx
@@ -39,8 +39,8 @@
 
 using namespace std;
 
-WSSession::WSSession( string bindingUrl, string repositoryId, 
-        string username, string password, bool verbose ) throw ( libcmis::Exception ) :
+WSSession::WSSession( string bindingUrl, string repositoryId, string username,
+        string password, bool verbose ) throw ( libcmis::Exception ) :
     BaseSession( bindingUrl, repositoryId, username, password, verbose ),
     m_servicesUrls( ),
     m_navigationService( NULL ),
@@ -336,7 +336,8 @@ VersioningService& WSSession::getVersioningService( )
     return *m_versioningService;
 }
 
-list< libcmis::RepositoryPtr > WSSession::getRepositories( string url, string username, string password, bool verbose ) throw ( libcmis::Exception )
+list< libcmis::RepositoryPtr > WSSession::getRepositories( string url, string username,
+        string password, bool verbose ) throw ( libcmis::Exception )
 {
     WSSession session( url, string(), username, password, verbose );
     return session.m_repositories;
diff --git src/libcmis/ws-session.hxx src/libcmis/ws-session.hxx
index 952e914..e8b806a 100644
--- src/libcmis/ws-session.hxx
+++ src/libcmis/ws-session.hxx
@@ -52,7 +52,7 @@ class WSSession : public BaseSession, public SoapSession
     public:
         WSSession( std::string bindingUrl, std::string repositoryId,
                    std::string username, std::string password,
-                   bool verbose ) throw ( libcmis::Exception );
+                   bool verbose = false ) throw ( libcmis::Exception );
         WSSession( const WSSession& copy );
         ~WSSession( );