/plugins/experimental/ssl_session_reuse/src/ssl_utils.h

https://github.com/apache/trafficserver · C Header · 70 lines · 28 code · 9 blank · 33 comment · 0 complexity · 73c188afd279577c587e79696ed3fdbe MD5 · raw file

  1. /** @file
  2. ssl_utils.h - a containuer of connection objects
  3. @section license License
  4. Licensed to the Apache Software Foundation (ASF) under one
  5. or more contributor license agreements. See the NOTICE file
  6. distributed with this work for additional information
  7. regarding copyright ownership. The ASF licenses this file
  8. to you under the Apache License, Version 2.0 (the
  9. "License"); you may not use this file except in compliance
  10. with the License. You may obtain a copy of the License at
  11. http://www.apache.org/licenses/LICENSE-2.0
  12. Unless required by applicable law or agreed to in writing, software
  13. distributed under the License is distributed on an "AS IS" BASIS,
  14. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. See the License for the specific language governing permissions and
  16. limitations under the License.
  17. */
  18. #pragma once
  19. #include <string>
  20. #include <iostream>
  21. #include <iomanip>
  22. #include <atomic>
  23. #include <openssl/ssl.h>
  24. #include <ts/ts.h>
  25. #include "publisher.h"
  26. #include "subscriber.h"
  27. #include "stek.h"
  28. struct ssl_session_param {
  29. std::string cluster_name;
  30. int key_update_interval; // STEK master rotation period seconds
  31. int stek_master; // bool - Am I the STEK setter/rotator for POD?
  32. ssl_ticket_key_t ticket_keys[2]; // current and past STEK
  33. std::string redis_auth_key_file;
  34. RedisPublisher *pub = nullptr;
  35. RedisSubscriber *sub;
  36. ssl_session_param();
  37. ~ssl_session_param();
  38. };
  39. int STEK_init_keys();
  40. const char *get_key_ptr();
  41. int get_key_length();
  42. /* Initialize ssl parameters */
  43. /**
  44. Return the result of initialization. If 0 is returned, it means
  45. the initializtion is success, -1 means it is failure.
  46. @param conf_file the configuration file
  47. @return @c 0 if it is success.
  48. */
  49. int init_ssl_params(const std::string &conf_file);
  50. int init_subscriber();
  51. int SSL_session_callback(TSCont contp, TSEvent event, void *edata);
  52. extern ssl_session_param ssl_param; // almost everything one needs is stored in here