Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
          +++ new/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
↓ open down ↓ 235 lines elided ↑ open up ↑
 236  236      AuthenticationInfo  currentServerCredentials = null;
 237  237      boolean             needToCheck = true;
 238  238      private boolean doingNTLM2ndStage = false; /* doing the 2nd stage of an NTLM server authentication */
 239  239      private boolean doingNTLMp2ndStage = false; /* doing the 2nd stage of an NTLM proxy authentication */
 240  240  
 241  241      /* try auth without calling Authenticator. Used for transparent NTLM authentication */
 242  242      private boolean tryTransparentNTLMServer = true;
 243  243      private boolean tryTransparentNTLMProxy = true;
 244  244  
 245  245      /* Used by Windows specific code */
 246      -    Object authObj;
      246 +    private Object authObj;
 247  247  
 248  248      /* Set if the user is manually setting the Authorization or Proxy-Authorization headers */
 249  249      boolean isUserServerAuth;
 250  250      boolean isUserProxyAuth;
 251  251  
 252  252      /* Progress source */
 253  253      protected ProgressSource pi;
 254  254  
 255  255      /* all the response headers we get back */
 256  256      private MessageHeader responses;
↓ open down ↓ 68 lines elided ↑ open up ↑
 325  325                      return pass;
 326  326                  }
 327  327              });
 328  328      }
 329  329  
 330  330      /* Logging support */
 331  331      public static PlatformLogger getHttpLogger() {
 332  332          return logger;
 333  333      }
 334  334  
      335 +    /* Used for Windows NTLM implementation */
      336 +    public Object authObj() {
      337 +        return authObj;
      338 +    }
      339 +
      340 +    public void authObj(Object authObj) {
      341 +        this.authObj = authObj;
      342 +    }
      343 +
 335  344      /*
 336  345       * checks the validity of http message header and throws
 337  346       * IllegalArgumentException if invalid.
 338  347       */
 339  348      private void checkMessageHeader(String key, String value) {
 340  349          char LF = '\n';
 341  350          int index = key.indexOf(LF);
 342  351          if (index != -1) {
 343  352              throw new IllegalArgumentException(
 344  353                  "Illegal character(s) in message header field: " + key);
↓ open down ↓ 2177 lines elided ↑ open up ↑
2522 2531              throw new NullPointerException ("key is null");
2523 2532  
2524 2533          checkMessageHeader(key, value);
2525 2534          requests.add(key, value);
2526 2535      }
2527 2536  
2528 2537      //
2529 2538      // Set a property for authentication.  This can safely disregard
2530 2539      // the connected test.
2531 2540      //
2532      -    void setAuthenticationProperty(String key, String value) {
     2541 +    public void setAuthenticationProperty(String key, String value) {
2533 2542          checkMessageHeader(key, value);
2534 2543          requests.set(key, value);
2535 2544      }
2536 2545  
2537 2546      @Override
2538 2547      public String getRequestProperty (String key) {
2539 2548          // don't return headers containing security sensitive information
2540 2549          if (key != null) {
2541 2550              for (int i=0; i < EXCLUDE_HEADERS.length; i++) {
2542 2551                  if (key.equalsIgnoreCase(EXCLUDE_HEADERS[i])) {
↓ open down ↓ 527 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX