Example #1
0
 public function testWriteToTmp()
 {
     $certificate = new Certificate('test');
     $path = $certificate->writeToTmp();
     $this->assertFileExists($path);
     $this->assertEquals('test', file_get_contents($path));
 }
Example #2
0
 /**
  * @return Resource
  */
 protected function createStreamContext()
 {
     $streamContext = stream_context_create();
     if (!empty($this->caFile)) {
         stream_context_set_option($streamContext, 'ssl', 'cafile', $this->caFile);
     }
     stream_context_set_option($streamContext, 'ssl', 'local_cert', $this->certificate->writeToTmp());
     return $streamContext;
 }
Example #3
0
 /**
  * @return Resource
  */
 protected function createStreamContext()
 {
     $streamContext = stream_context_create();
     stream_context_set_option($streamContext, 'ssl', 'local_cert', $this->certificate->writeToTmp());
     return $streamContext;
 }