1: <?php
2: /**
3: * PHP OpenCloud library.
4: *
5: * @copyright Copyright 2013 Rackspace US, Inc. See COPYING for licensing information.
6: * @license https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0
7: * @version 1.6.0
8: * @author Glen Campbell <glen.campbell@rackspace.com>
9: * @author Jamie Hannaford <jamie.hannaford@rackspace.com>
10: */
11:
12: namespace OpenCloud\LoadBalancer\Resources;
13:
14: /**
15: * The SSL Termination feature allows a load balancer user to terminate SSL
16: * traffic at the load balancer layer versus at the web server layer. A user may
17: * choose to configure SSL Termination using a key and an SSL certificate or an
18: * (Intermediate) SSL certificate.
19: *
20: * When SSL Termination is configured on a load balancer, a secure shadow server
21: * is created that listens only for secure traffic on a user-specified port.
22: * This shadow server is only visible to and manageable by the system. Existing
23: * or updated attributes on a load balancer with SSL Termination will also apply
24: * to its shadow server. For example, if Connection Logging is enabled on an SSL
25: * load balancer, it will also be enabled on the shadow server and Cloud Files
26: * logs will contain log files for both.
27: *
28: * @link http://docs.rackspace.com/loadbalancers/api/v1.0/clb-devguide/content/SSLTermination-d1e2479.html
29: */
30: class SSLTermination extends SubResource
31: {
32:
33: /**
34: * The certificate used for SSL termination.
35: *
36: * @var string
37: */
38: public $certificate;
39:
40: /**
41: * Determines if the load balancer is enabled to terminate SSL traffic.
42: * If set to FALSE, the load balancer will retain its specified SSL
43: * attributes, but will not terminate SSL traffic.
44: *
45: * @var bool
46: */
47: public $enabled;
48:
49: /**
50: * Determines if the load balancer may accept only secure traffic.
51: * If set to TRUE, the load balancer will not accept non-secure traffic.
52: *
53: * @var bool
54: */
55: public $secureTrafficOnly;
56:
57: /**
58: * The private key for the SSL certificate.
59: *
60: * @var string
61: */
62: public $privatekey;
63:
64: /**
65: * The user's intermediate certificate used for SSL termination.
66: *
67: * @var string
68: */
69: public $intermediateCertificate;
70:
71: /**
72: * The port on which the SSL termination load balancer will listen for secure traffic.
73: *
74: * @var int
75: */
76: public $securePort;
77:
78: protected static $json_name = "sslTermination";
79: protected static $url_resource = "ssltermination";
80: protected $createKeys = array(
81: 'certificate',
82: 'enabled',
83: 'secureTrafficOnly',
84: 'privatekey',
85: 'intermediateCertificate',
86: 'securePort'
87: );
88:
89: public function create($params = array())
90: {
91: return $this->update($params);
92: }
93:
94: }
95: