OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "bin/secure_socket.h" | 5 #include "bin/secure_socket.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 | 255 |
256 status = NSS_SetDomesticPolicy(); | 256 status = NSS_SetDomesticPolicy(); |
257 if (status != SECSuccess) { | 257 if (status != SECSuccess) { |
258 ThrowPRException("Unsuccessful NSS_SetDomesticPolicy call."); | 258 ThrowPRException("Unsuccessful NSS_SetDomesticPolicy call."); |
259 } | 259 } |
260 // Enable TLS, as well as SSL3 and SSL2. | 260 // Enable TLS, as well as SSL3 and SSL2. |
261 status = SSL_OptionSetDefault(SSL_ENABLE_TLS, PR_TRUE); | 261 status = SSL_OptionSetDefault(SSL_ENABLE_TLS, PR_TRUE); |
262 if (status != SECSuccess) { | 262 if (status != SECSuccess) { |
263 ThrowPRException("Unsuccessful SSL_OptionSetDefault enable TLS call."); | 263 ThrowPRException("Unsuccessful SSL_OptionSetDefault enable TLS call."); |
264 } | 264 } |
| 265 status = SSL_ConfigServerSessionIDCache(0, 0, 0, NULL); |
| 266 if (status != SECSuccess) { |
| 267 ThrowPRException("Unsuccessful SSL_ConfigServerSessionIDCache call."); |
| 268 } |
| 269 |
265 } else { | 270 } else { |
266 ThrowException("Called SSLFilter::InitializeLibrary more than once"); | 271 ThrowException("Called SSLFilter::InitializeLibrary more than once"); |
267 } | 272 } |
268 } | 273 } |
269 | 274 |
270 char* PasswordCallback(PK11SlotInfo* slot, PRBool retry, void* arg) { | 275 char* PasswordCallback(PK11SlotInfo* slot, PRBool retry, void* arg) { |
271 if (!retry) { | 276 if (!retry) { |
272 return PL_strdup(static_cast<char*>(arg)); // Freed by NSS internals. | 277 return PL_strdup(static_cast<char*>(arg)); // Freed by NSS internals. |
273 } | 278 } |
274 return NULL; | 279 return NULL; |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 if (PR_WOULD_BLOCK_ERROR != pr_error) { | 480 if (PR_WOULD_BLOCK_ERROR != pr_error) { |
476 ThrowPRException("Error reading plaintext from SSLFilter"); | 481 ThrowPRException("Error reading plaintext from SSLFilter"); |
477 } | 482 } |
478 bytes_processed = 0; | 483 bytes_processed = 0; |
479 } | 484 } |
480 break; | 485 break; |
481 } | 486 } |
482 } | 487 } |
483 return bytes_processed; | 488 return bytes_processed; |
484 } | 489 } |
OLD | NEW |